View source: R/polar_annulusMap.R
annulusMap | R Documentation |
The annulusMap()
function creates a map using polar annulus plots as
markers. Any number of pollutants can be specified using the pollutant
argument, and multiple layers of markers can be created using type
. By
default, these maps are dynamic and can be panned, zoomed, and otherwise
interacted with. Using the static
argument allows for static images to be
produced instead.
annulusMap(
data,
pollutant = NULL,
period = "hour",
limits = "free",
latitude = NULL,
longitude = NULL,
crs = 4326,
type = NULL,
popup = NULL,
label = NULL,
provider = "OpenStreetMap",
cols = "turbo",
alpha = 1,
key = FALSE,
legend = TRUE,
legend.position = NULL,
legend.title = NULL,
legend.title.autotext = TRUE,
control.collapsed = FALSE,
control.position = "topright",
control.autotext = TRUE,
d.icon = 200,
d.fig = 3.5,
static = FALSE,
static.nrow = NULL,
...,
control = NULL
)
data |
Input data table with pollutant, wind, and geo-spatial information. required | scope: dynamic & static A data frame. The data frame must contain the data to plot the directional
analysis marker, which includes wind speed ( |
pollutant |
Pollutant name(s). required | scope: dynamic & static The column name(s) of the pollutant(s) to plot. If multiple pollutants are
specified the
Multiple |
period |
Temporal period for radial axis. default: Options are "hour" (the default, to plot diurnal variations), "season" to plot variation throughout the year, "weekday" to plot day of the week variation and "trend" to plot the trend by wind direction. |
limits |
Specifier for the plot colour scale bounds. default: One of:
|
latitude , longitude |
The decimal latitude(Y)/longitude(X). default: Column names representing the decimal latitude and longitude (or other Y/X
coordinate if using a different |
crs |
The coordinate reference system (CRS). default: The coordinate reference system (CRS) of the data, passed to
|
type |
A method to condition the default: Used for splitting the input data into different groups, passed to the
|
popup |
Content for marker popups on dynamic maps. default: Columns to be used as the HTML content for marker popups on dynamic maps.
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 |
Content for marker hover-over on dynamic maps. default: 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 basemap(s) to be used. default: The base map(s) to be used beneath the polar markers. If not provided, will
default to
There is some overlap in static and dynamic providers. For example,
|
cols |
Colours to use for plotting. default: The colours used for plotting, passed to |
alpha |
Transparency value for polar markers. default: A value between 0 (fully transparent) and 1 (fully opaque). |
key |
Draw individual marker legends? default: Draw a key for each individual marker? Potentially useful when |
legend |
Draw a shared legend? default: When all markers share the same colour scale (e.g., when |
legend.position |
Position of the shared legend. default: When
|
legend.title |
Title of the legend. default: By default, when |
legend.title.autotext |
Automatically format the title of the legend? default: When |
control.collapsed |
Show the layer control as a collapsed? default: For dynamic maps, should the "layer control" interface be collapsed? If
|
control.position |
Position of the layer control menu default: When |
control.autotext |
Automatically format the content of the layer control menu? default: When |
d.icon |
The diameter of the plot on the map in pixels. default: 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 default: This will affect the resolution of the markers on the map. Alternatively, a
vector in the form |
static |
Produce a static map? default: This controls whether a dynamic or static map is produced. The former is the default and is broadly more useful, but the latter may be preferable for DOCX or PDF outputs (e.g., academic papers). |
static.nrow |
Number of rows in a static map. default: Controls the number of rows of panels on a static map when multiple
|
... |
Arguments passed on to
|
control |
Deprecated. Please use |
Either:
Dynamic: A leaflet object
Static: A ggplot2
object using ggplot2::coord_sf()
coordinates with a ggspatial
basemap
As the outputs of the static directional analysis functions are ggplot2
figures, further customisation is possible using functions such as
ggplot2::theme()
, ggplot2::guides()
and ggplot2::labs()
.
If multiple pollutants are specified, subscripting (e.g., the "x" in "NOx")
is achieved using the ggtext package. Therefore if you
choose to override the plot theme, it is recommended to use
[ggplot2::theme()]
and [ggtext::element_markdown()]
to define the
strip.text
parameter.
When arguments like limits
, percentile
or breaks
are defined, a
legend is automatically added to the figure. Legends can be removed using
ggplot2::theme(legend.position = "none")
, or further customised using
ggplot2::guides()
and either color = ggplot2::guide_colourbar()
for
continuous legends or fill = ggplot2::guide_legend()
for discrete
legends.
openair::polarAnnulus()
Other directional analysis maps:
diffMap()
,
freqMap()
,
percentileMap()
,
polarMap()
,
pollroseMap()
,
windroseMap()
## Not run:
annulusMap(polar_data,
pollutant = "nox",
period = "hour",
provider = "CartoDB.Voyager"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.