Trajectory line plots in
This function plots back trajectories on a
leaflet map. This function
requires that data are imported using the
Options are provided to colour the individual trajectories (e.g., by
pollutant concentrations) or create "layer control" menus to show/hide
trajMap( data, longitude = "lon", latitude = "lat", colour, control = "default", cols = "default", alpha = 0.5, npoints = 12, provider = "OpenStreetMap", collapse.control = FALSE )
Data frame, the result of importing a trajectory file using
- latitude, longitude
The decimal latitude/longitude.
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
dplyr::left_join()) to the trajectory data by "date".
Used for splitting the trajectories into different groups which can be selected between using a "layer control" menu. Passed to
Colours to be used for plotting. Options include "default", "increment", "heat", "turbo" and
RColorBrewercolours — see the
openair::openColours()function for more details. For user defined the user can supply a list of colour names recognised by R (type
grDevices::colours()to see the full list). An example would be
cols = c("yellow", "green", "blue"). If the
"colour"argument was not used, a single colour can be named which will be used consistently for all lines/points (e.g.,
cols = "red").
Opacity of lines/points. Must be between
A dot is placed every
npointsalong each full trajectory. For hourly back trajectories points are plotted every
npointshours. This helps to understand where the air masses were at particular times and get a feel for the speed of the air (points closer together correspond to slower moving air masses). Defaults to
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.
Should the "layer control" interface be collapsed? Defaults to