R/stat_dailyAQCategory.R
stat_dailyAQCategory.Rd
This function calculates the daily averaged AQI PM25 categories for the data and colors the data by AQI cateogry when it is added to a plot. The default is to add them as bars.
stat_dailyAQCategory( mapping = NULL, data = NULL, mv4Colors = FALSE, timezone = NULL, minHours = 18, width = 0.8, adjustylim = FALSE, missingDataBar = TRUE, geom = "bar", position = "identity", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ... )
mapping | Set of aesthetic mappings created by |
---|---|
data | The data to be displayed in this layer. There are three options:
if |
mv4Colors | If |
timezone | timezone for day start and end for averaging. If |
minHours | Minimum number oof valid data hours required to calculate each daily statistic |
width | bar width in units of days. |
adjustylim | if |
missingDataBar | if |
geom | The geometic object to display the data |
position | Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm | remove NA values from data |
show.legend | logical indicating whether this layer should be included in legends. |
inherit.aes | if |
... | additional arguments passed on to |
if (FALSE) { library(AirMonitorPlots) monitor <- airsis_loadLatest() ggplot_pm25Timeseries(monitor) + stat_AQCategory(color = NA, width = 3000) + stat_dailyAQCategory(alpha = .5, missingDataBar = FALSE, width = 1, size = 1) + facet_wrap(~deviceDeploymentID) monitor <- airnow_loadLatest() %>% monitor_filter(id = "575243c65b9e4719_160690012") ggplot_pm25Timeseries(mts_monitor) + stat_dailyAQCategory() }