R/monitor_ggTimeseries.R
monitor_ggTimeseries.Rd
This function assembles various layers to create a production-ready timeseries plot for one or more monitors.
monitor_ggTimeseries(
monitor,
startdate = NULL,
enddate = NULL,
id = NULL,
style = c("small", "large"),
title = NULL,
timezone = NULL,
...
)
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).
vector of deviceDeploymentIDs to include in the plot. If more than one, different monitors will be plotted in different colors.
Plot style. small
or large
. style = small
is appropriate for plots 450x450px or smaller; style = large
is
appropriate for plots larger than 450x450px.
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.
Arguments passed onto ggplot_pm25Timeseries
.
A ggplot object.
library(AirMonitorPlots)
AirMonitor::NW_Megafires %>%
monitor_ggTimeseries(
startdate = 20150815,
enddate = 20150831,
id = "d01b991c53583048_160690012_03"
)
#> 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 691 rows containing missing values or values outside the scale range
#> (`geom_pm25points()`).
#> Warning: Removed 681 rows containing missing values or values outside the scale range
#> (`geom_path()`).
AirMonitor::Carmel_Valley %>%
monitor_ggTimeseries(
startdate = 20160801,
enddate = 20160810
)
#> 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 358 rows containing missing values or values outside the scale range
#> (`geom_pm25points()`).
#> Warning: Removed 351 rows containing missing values or values outside the scale range
#> (`geom_path()`).