if (FALSE) {
library(leaflet)
library(openair)
# different types of polar plot on one map
leaflet(data = polar_data) %>%
addTiles() %>%
addPolarMarkers("ws",
fun = openair::windRose,
group = "Wind Rose"
) %>%
addPolarMarkers("nox",
fun = openair::polarPlot,
group = "Polar Plot"
) %>%
addLayersControl(
baseGroups = c("Wind Rose", "Polar Plot")
)
# use of polar diff (NB: both 'before' and 'after' inherit from `leaflet()`,
# so at least one should be overridden - in this case 'after')
leaflet(data = polar_data) %>%
addTiles() %>%
addPolarDiffMarkers("nox",
after = dplyr::mutate(polar_data, nox = jitter(nox, 5))
)
}
Run the code above in your browser using DataLab