plot_station_measurements {ubair} | R Documentation |
Descriptive plot of daily time series data
Description
This function produces descriptive time-series plots with smoothing for the meteorological and potential target variables that were measured at a station.
Usage
plot_station_measurements(
env_data,
variables,
years = NULL,
smoothing_factor = 1
)
Arguments
env_data |
A data table of measurements of one air quality measurement station. The data should contain the following columns:
|
variables |
list of variables to plot. Must be in |
years |
Optional. A numeric vector, list, or a range specifying the years to restrict the plotted data. You can provide:
|
smoothing_factor |
A number that defines the magnitude of smoothing. Default is 1. Smaller numbers correspond to less smoothing, larger numbers to more. |
Value
A ggplot
object. This object contains:
A time-series line plot for each variable in
variables
.Smoothed lines, with smoothing defined by
smoothing_factor
.
Examples
library(data.table)
env_data <- data.table(
Station = "Station_1",
Komponente = rep(c("TMP", "NO2"), length.out = 100),
Wert = rnorm(100, mean = 20, sd = 5),
date = rep(seq.POSIXt(as.POSIXct("2022-01-01"), , "hour", 50), each = 2),
year = 2022,
Komponente_txt = rep(c("Temperature", "NO2"), length.out = 100)
)
plot <- plot_station_measurements(env_data, variables = c("TMP", "NO2"))