View source: R/polar_diffMap.R
diffMap | R Documentation |
diffMap()
creates a leaflet
map using bivariate polar "difference" plots
as markers. Any number of pollutants can be specified using the pollutant
argument, and multiple layers of markers can be added and toggled between
using control
.
diffMap(
before,
after,
pollutant = NULL,
x = "ws",
limits = "free",
latitude = NULL,
longitude = NULL,
control = NULL,
popup = NULL,
label = NULL,
provider = "OpenStreetMap",
cols = c("#002F70", "#3167BB", "#879FDB", "#C8D2F1", "#F6F6F6", "#F4C8C8", "#DA8A8B",
"#AE4647", "#5F1415"),
alpha = 1,
key = FALSE,
draw.legend = TRUE,
collapse.control = FALSE,
d.icon = 200,
d.fig = 3.5,
type = deprecated(),
...
)
before |
A data frame that represents the "before" case. See
|
after |
A data frame that represents the "after" case. See |
pollutant |
Mandatory. A pollutant name corresponding to a variable in a
data frame should be supplied e.g. |
x |
Name of variable to plot against wind direction in polar coordinates, the default is wind speed, “ws”. |
limits |
By default, each individual polar marker has its own colour
scale. The |
latitude, longitude |
The decimal latitude/longitude. If not provided, will be automatically inferred from data by looking for a column named "lat"/"latitude" or "lon"/"lng"/"long"/"longitude" (case-insensitively). |
control |
Used for splitting the input data into different groups which
can be selected between using a "layer control" interface, passed to the
|
popup |
Columns to be used as the HTML content for marker popups. Popups
may be useful to show information about the individual sites (e.g., site
names, codes, types, etc.). If a vector of column names are provided they
are passed to |
label |
Column to be used as the HTML content for hover-over labels. Labels are useful for the same reasons as popups, though are typically shorter. |
provider |
The base map(s) to be used. See
http://leaflet-extras.github.io/leaflet-providers/preview/ for a list of
all base maps that can be used. If multiple base maps are provided, they
can be toggled between using a "layer control" interface. By default, the
interface will use the provider names as labels, but users can define their
own using a named vector (e.g., |
cols |
The colours used for plotting. It is recommended to use a "diverging" colour palette (along with a symmetrical limit scale) for effective visualisation. |
alpha |
The alpha transparency to use for the plotting surface (a value between 0 and 1 with zero being fully transparent and 1 fully opaque). |
key |
Should a key for each marker be drawn? Default is |
draw.legend |
When |
collapse.control |
Should the "layer control" interface be collapsed?
Defaults to |
d.icon |
The diameter of the plot on the map in pixels. This will affect
the size of the individual polar markers. Alternatively, a vector in the
form |
d.fig |
The diameter of the plots to be produced using |
type |
. Different sites are now
automatically detected based on latitude and longitude. Please use |
... |
Arguments passed on to
|
A leaflet object.
the original openair::polarDiff()
diffMapStatic()
for the static ggmap
equivalent of diffMap()
Other interactive directional analysis maps:
annulusMap()
,
freqMap()
,
percentileMap()
,
polarMap()
,
pollroseMap()
,
windroseMap()
## Not run:
# NB: "after" is some dummy data to demonstrate functionality
diffMap(
before = polar_data,
after = dplyr::mutate(polar_data, nox = jitter(nox, factor = 5)),
pollutant = "nox",
provider = "Stamen.Toner"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.