
Calculate clusters for back trajectories
traj_cluster.RdThis function carries out cluster analysis of HYSPLIT back trajectories. The
function is specifically designed to work with the trajectories imported
using the openair::importTraj() function, which provides pre-calculated
back trajectories at specific receptor locations. Clustered trajectories can
be visualised using traj_plot().
Usage
traj_cluster(
data,
method = "Euclid",
n_clusters = 5,
facet = NULL,
split_after = FALSE,
return = "plot",
...
)Arguments
- data
Data frame, the result of importing a trajectory file using
openair::importTraj().- method
Method used to calculate the distance matrix for the back trajectories. There are two methods available: "Euclid" and "Angle".
- n_clusters
Number of clusters to calculate.
- facet
One or two faceting columns.
facetdetermines how the data are split and then clustered. Note that the cluster calculations are separately made of each level of "type".- split_after
When
facet!=NULL, the trajectories can either be calculated for each facet independently or extracted after the cluster calculations have been applied to the whole data set.- return
"plot"(the default) or"data"."plot"will return plotted clusters for visual analysis so that an appropriate value forn_clusterscan be selected. When such a value has been chosen,"data"will return the original data frame appended with aclustercolumn for use in, for example,trend_prop().- ...
Arguments passed on to
traj_plotalphaTransparency of the plots/lines, where
1is completely opaque and0is completely transparent.n_pointsA dot is placed every
n_pointsalong each full trajectory. For hourly back trajectories points are plotted everynpointhours. 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). Ifn_points = NULLthen no points are added.mapShould a base map be drawn? If
TRUEthe world base map from themapspackage is used.map_fillFill colour of map.
map_colourLine colour of map.
map_alphaAlpha of map.
lon_range,lat_rangeLongitude and latitude range, provided as a numeric vector of length 2.
crsThe coordinate reference system (CRS) used for the base map. Defaults to
4326, which behaves similarly to Cartesian coordinates. A useful alternative could be3035(the "lambert" projection).
See also
Other trajectory analysis functions:
traj_level(),
traj_plot()