ggdiurnal_weekend | R Documentation |
rOstluft::format_rolf()
format) for diurnal time course-stats
including weekend-effectggplot2-wrapper to summarise and plot data (of rOstluft::format_rolf()
format) for diurnal time course-stats
including weekend-effect
ggdiurnal_weekend(
data,
y = "value",
nmin = 3,
fun = list(middle = "mean", middle2 = "median", ymin = "percentile05", lower =
"percentile25", upper = "percentile75", ymax = "percentile95"),
ribbon_color = "gray60",
middle_color = "gray30",
expand_xscale = 0
)
data |
a data.frame or tibble containing the data |
y |
a character string specifying the taget variable to be summarised, usually "value".
outcomes of |
nmin |
numeric, minimum number of values for fun, if n < nmin: NA is returned |
fun |
function or list of functions for summary, can be named (then the outut stat is named after the function's name);
Strings matching the regular expression |
ribbon_color |
character string for specifying the ribbon color. |
middle_color |
character string for specifying the middle's color. |
expand_xscale |
multiplicative range expansion factor |
ggplot2::ggplot()
object
library(ggplot2)
fn <- rOstluft.data::f("Zch_Stampfenbachstrasse_2010-2014.csv")
data <-
rOstluft::read_airmo_csv(fn) %>%
dplyr::filter(parameter %in% c("NOx", "O3", "PM10")) %>%
rOstluft::resample(new_interval = "h1")
ggdiurnal_weekend(data)
# y scale: no expand on zero
ggdiurnal_weekend(data) +
scale_y_continuous(limits = c(0, NA), expand = expansion(mult = c(0, 0.05))) +
theme(panel.spacing.y = unit(12, "pt"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.