trajCluster.Rd
This 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 precalculated back
trajectories at specific receptor locations.
trajCluster(traj, method = "Euclid", n.cluster = 5, plot = TRUE, type = "default", cols = "Set1", split.after = FALSE, map.fill = TRUE, map.cols = "grey40", map.alpha = 0.4, projection = "lambert", parameters = c(51, 51), orientation = c(90, 0, 0), by.type = FALSE, origin = TRUE, ...)
traj  An openair trajectory data frame resulting from the
use of 

method  Method used to calculate the distance matrix for the back trajectories. There are two methods available: “Euclid” and “Angle”. 
n.cluster  Number of clusters to calculate. 
plot  Should a plot be produced? 
type 

cols  Colours to be used for plotting. Options include
“default”, “increment”, “heat”,
“jet” and 
split.after  For 
map.fill  Should the base map be a filled polygon? Default is to fill countries. 
map.cols  If 
map.alpha  The transpency level of the filled map which takes values from 0 (full transparency) to 1 (full opacity). Setting it below 1 can help view trajectories, trajectory surfaces etc. and a filled base map. 
projection  The map projection to be used. Different map
projections are possible through the 
parameters  From the 
orientation  From the 
by.type  The percentage of the total number of trajectories
is given for all data by default. Setting 
origin  If 
...  Other graphical parameters passed onto

Returns a list with two data components. The first
(data
) contains the orginal data with the cluster
identified. The second (results
) contains the data used
to plot the clustered trajectories.
Two main methods are available to cluster the back trajectories using two different calculations of the distance matrix. The default is to use the standard Euclidian distance between each pair of trajectories. Also available is an anglebased distance matrix based on Sirois and Bottenheim (1995). The latter method is useful when the interest is the direction of the trajectories in clustering.
The distance matrix calculations are made in C++ for speed. For
data sets of up to 1 year both methods should be relatively fast,
although the method = "Angle"
does tend to take much longer
to calculate. Further details of these methods are given in the
openair manual.
Sirois, A. and Bottenheim, J.W., 1995. Use of backward trajectories to interpret the 5year record of PAN and O3 ambient air concentrations at Kejimkujik National Park, Nova Scotia. Journal of Geophysical Research, 100: 28672881.
# NOT RUN { ## import trajectories traj < importTraj(site = "london", year = 2009) ## calculate clusters clust < trajCluster(traj, n.clusters = 5) head(clust$data) ## note new variable 'cluster' ## use different distance matrix calculation, and calculate by season traj < trajCluster(traj, method = "Angle", type = "season", n.clusters = 4) # }