R/monitor_performanceMap.R
monitor_performanceMap.Rd
This function uses confusion matrix analysis to calculate different
measures of predictive performance for every timeseries found in
predicted
with respect to the observed values found in the single
timeseries found in observed
.
Using a single number for the breaks
argument will cause the algorithm
to use quantiles to determine breaks.
monitor_performanceMap( predicted, observed, threshold = AQI$breaks_24[3], cex = par("cex"), sizeBy = NULL, colorBy = "heidikeSkill", breaks = c(-Inf, 0.5, 0.6, 0.7, 0.8, Inf), paletteFunc = grDevices::colorRampPalette(RColorBrewer::brewer.pal(length(breaks), "Purples")[-1]), showLegend = TRUE, legendPos = "topright", stateCol = "grey60", stateLwd = 2, countyCol = "grey70", countyLwd = 1, add = FALSE, ... )
predicted | ws_monitor object with predicted values |
---|---|
observed | ws_monitor object with observed values |
threshold | value used to classify |
cex | the amount that the points will be magnified on the map |
sizeBy | name of the metric used to create relative sizing |
colorBy | name of the metric used to create relative colors |
breaks | set of breaks used to assign colors or a single integer used to provide quantile based breaks - Must also specify the colorBy paramater |
paletteFunc | a palette generating function as returned by
|
showLegend | logical specifying whether to add a legend (default:
|
legendPos | legend position passed to |
stateCol | color for state outlines on the map |
stateLwd | width for state outlines |
countyCol | color for county outline on the map |
countyLwd | width for county outlines |
add | logical specifying whether to add to the current plot |
... | additional arguments to be passed to the |
Setting either sizeBy
or colorBy
to NULL
will cause the
size/colors to remain constant.
if (FALSE) { # Fail gracefully if any resources are not available try({ library(PWFSLSmoke) # Napa Fires -- October, 2017 ca <- airnow_load(2017) %>% monitor_subset(tlim=c(20171001,20171101), stateCodes='CA') Vallejo <- monitor_subset(ca, monitorIDs='060950004_01') Napa_Fires <- monitor_subsetByDistance(ca, longitude = Vallejo$meta$longitude, latitude = Vallejo$meta$latitude, radius = 50) monitor_performanceMap(ca, Vallejo, cex = 2) title('Heidke Skill of monitors predicting another monitor.') }, silent = FALSE) }