R/monitor_ggDailyBarplot.R
monitor_ggDailyBarplot.Rd
This function assembles various layers to create a production-ready daily barplot for one or more monitors.
The full range of data in monitor
will be used unless both
startdate
and enddate
are specified.
monitor_ggDailyBarplot(
monitor,
startdate = NULL,
enddate = NULL,
id = NULL,
style = c("small", "large"),
title = NULL,
timezone = NULL,
today = TRUE,
...
)
A mts_monitor object.
Desired start date (integer or character in ymd format or POSIXct).
Desired end date (integer or character in ymd format or POSIXct).
deviceDeploymentID to include in the plot. This can be NULL if
monitor
only has one unique deviceDeploymentID.
String indicating plotting style. Either "large"
or
"small"
. style = "large"
is suitable for plots larger than
450x450px, and "small"
is suitable for plots 450x450px or smaller.
Plot title. If NULL, a suitable title will be constructed.
Olson timezone name for x-axis scale and date parsing. If NULL the timezone of the specified monitor will be used.
Logical indicating whether to include a shaded "current NowCast" bar for Today. Ignored if data is not current.
Arguments passed onto ggplot_pm25Timeseries
.
A ggplot object
library(AirMonitorPlots)
AirMonitor::Carmel_Valley %>%
monitor_ggDailyBarplot(
startdate = 20160801,
enddate = 20160810
)
#> Scale for y is already present.
#> Adding another scale for y, which will replace the existing scale.
#> Warning: Removed 7 rows containing non-finite outside the scale range
#> (`stat_daily_aqi_level()`).
#> Warning: The following aesthetics were dropped during statistical transformation: x and
#> y.
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#> the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#> variable into a factor?
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_bar()`).