trajMap | R Documentation |
leaflet
This function plots back trajectories on a leaflet
map. This function
requires that data are imported using the openair::importTraj()
function.
Options are provided to colour the individual trajectories (e.g., by
pollutant concentrations) or create "layer control" menus to show/hide
different layers.
trajMap(
data,
longitude = "lon",
latitude = "lat",
colour,
control = "default",
cols = "default",
alpha = 0.5,
npoints = 12,
provider = "OpenStreetMap",
collapse.control = FALSE
)
data |
Data frame, the result of importing a trajectory file using
|
latitude, longitude |
The decimal latitude/longitude. |
colour |
Column to be used for colouring each trajectory. This column
may be numeric, character or factor. This will commonly be a pollutant
concentration which has been joined (e.g., by |
control |
Used for splitting the trajectories into different groups
which can be selected between using a "layer control" menu. Passed to
|
cols |
Colours to be used for plotting. Options include "default",
"increment", "heat", "turbo" and |
alpha |
Opacity of lines/points. Must be between |
npoints |
A dot is placed every |
provider |
The base map to be used. See http://leaflet-extras.github.io/leaflet-providers/preview/ for a list of all base maps that can be used. |
collapse.control |
Should the "layer control" interface be collapsed?
Defaults to |
A leaflet object.
the original openair::trajPlot()
trajMapStatic()
for the static ggplot2
equivalent of trajMap()
Other interactive trajectory maps:
trajLevelMap()
## Not run:
trajMap(traj_data, colour = "nox")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.