openair
importTraj
function, which provides pre-calculated 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, ...)
importTraj
.type
determines how the data are split
i.e. conditioned, and then plotted. The default is will produce a
single plot using the entire data. Type can be one of the built-in
types as detailed in cutData
e.g. RColorBrewer
colours --- see the openair
openColours
function fortype
other than type
independently or extracted after the cluster
calculations have been applied to the whole map.fill = TRUE
map.cols
controls
the fill colour. Examples include map.fill = "grey40"
and
map.fill = openColours("default", 10)
. The latter colours
the countries and can help differentiate them.lattice:levelplot
and cutData
. Similarly, common
axis and title labelling options (such as xlab
,
ylab
, main
) are passed to levelplot
via
<cluster
giving the calculated cluster.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.
importTraj
, trajPlot
, trajLevel
## import trajectories
traj <- importTraj(site = "london", year = 2009)
## calculate clusters
traj <- trajCluster(traj, n.clusters = 5)
head(traj) ## note new variable 'cluster'
## use different distance matrix calculation, and calculate by season
traj <- trajCluster(traj, method = "Angle", type = "season", n.clusters = 4)
Run the code above in your browser using DataLab