Skip to contents

This function plots back trajectories on a leaflet map. This function requires that data are imported using the openair::importTraj() function.


  longitude = "lon",
  latitude = "lat",
  control = "default",
  smooth = FALSE,
  statistic = "frequency",
  percentile = 90, = 1, = 1,
  min.bin = 1,
  .combine = NA,
  sigma = 1.5,
  cols = "default",
  alpha = 0.5,
  tile.border = NA,
  provider = "OpenStreetMap"



Data frame, the result of importing a trajectory file using openair::importTraj().

latitude, longitude

The decimal latitude/longitude.


Pollutant to be plotted. By default the trajectory height is used.


Used for splitting the trajectories into different groups which can be selected between using a "layer control" menu. Passed to openair::cutData().


Should the trajectory surface be smoothed? Defaults to FALSE. Note that, when smooth = TRUE, no popup information will be available.


Statistic to use for trajLevel(). By default, the function will plot the trajectory frequencies (statistic = "frequency"). As an alternative way of viewing trajectory frequencies, the argument method = "hexbin" can be used. In this case hexagonal binning of the trajectory points (i.e., a point every three hours along each back trajectory). The plot then shows the trajectory frequencies uses hexagonal binning.

There are also various ways of plotting concentrations.

It is possible to set statistic = "difference". In this case trajectories where the associated concentration is greater than percentile are compared with the the full set of trajectories to understand the differences in frequencies of the origin of air masses. The comparison is made by comparing the percentage change in gridded frequencies. For example, such a plot could show that the top 10\ tend to originate from air-mass origins to the east.

If statistic = "pscf" then a Potential Source Contribution Function map is produced. This statistic method interacts with percentile.

If statistic = "cwt" then concentration weighted trajectories are plotted.

If statistic = "sqtba" then Simplified Quantitative Transport Bias Analysis is undertaken. This statistic method interacts with .combine and sigma.


The percentile concentration of pollutant against which the all trajectories are compared.,

The longitude and latitude intervals to be used for binning data.


The minimum number of unique points in a grid cell. Counts below min.bin are set as missing.


When statistic is "SQTBA" it is possible to combine lots of receptor locations to derive a single map. .combine identifies the column that differentiates different sites (commonly a column named "site"). Note that individual site maps are normalised first by dividing by their mean value.


For the SQTBA approach sigma determines the amount of back trajectory spread based on the Gaussian plume equation. Values in the literature suggest 5.4 km after one hour. However, testing suggests lower values reveal source regions more effectively while not introducing too much noise.


Colours to be used for plotting. Options include "default", "increment", "heat", "turbo" and RColorBrewer colours — 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").


Opacity of the tiles. Must be between 0 and 1.


Colour to use for the border of binned tiles. Defaults to NA, which draws no border.


The base map to be used. See for a list of all base maps that can be used.


A leaflet object.

See also

the original openair::trajLevel()

trajLevelMapStatic() for the static ggplot2 equivalent of trajLevelMap()

Other interactive trajectory maps: trajMap()


if (FALSE) {
trajLevelMap(traj_data, pollutant = "pm2.5", statistic = "pscf", min.bin = 10)