monitor_performanceMap: Create map of monitor prediction performance

Description Usage Arguments Details See Also Examples

View source: R/monitor_performanceMap.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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,
  ...
)

Arguments

predicted

ws_monitor object with predicted values

observed

ws_monitor object with observed values

threshold

value used to classify predicted and observed measurements

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 colorRampPalette

showLegend

logical specifying whether to add a legend (default: TRUE)

legendPos

legend position passed to legend()

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 maps::map() funciton such as graphical parameters (see code?par)

Details

Setting either sizeBy or colorBy to NULL will cause the size/colors to remain constant.

See Also

monitor_performance

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# 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)

## End(Not run)

PWFSLSmoke documentation built on Nov. 23, 2021, 5:06 p.m.