View source: R/visualisation.R
plot_station_measurements | R Documentation |
This function produces descriptive time-series plots with smoothing for the meteorological and potential target variables that were measured at a station.
plot_station_measurements(
env_data,
variables,
years = NULL,
smoothing_factor = 1
)
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. |
A ggplot
object. This object contains:
A time-series line plot for each variable in variables
.
Smoothed lines, with smoothing defined by smoothing_factor
.
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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.