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, projection = "lambert",
parameters = c(51, 51), orientation = c(90, 0, 0), by.type = FALSE,
origin = TRUE, ...)
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.
“season”, “year”, “weekday” and so on. For
example, type = "season"
will produce four plots --- one
for each season. Note that the cluster calculations are
separately made of each level of "type".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 colours()
to see the full list). An
example would be cols = c("yellow", "green", "blue")
type
other than “default”
e.g. “season”, the trajectories can either be calculated
for each level of type
independently or extracted after
the cluster calculations have been applied to the whole data
set.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.mapproj
package.
See?mapproject
for extensive details and information on
setting other parameters and orientation (see below).mapproj
package. Optional
numeric vector of parameters for use with the projection
argument. This argument is optional only in the sense that
certain projections do not require additional parameters. If a
projection does require additional parameters, these must be
given in the parameters argument.mapproj
package. An optional
vector c(latitude,longitude,rotation) which describes where the
"North Pole" should be when computing the projection. Normally
this is c(90,0), which is appropriate for cylindrical and conic
projections. For a planar projection, you should set it to the
desired point of tangency. The third value is a clockwise
rotation (in degrees), which defaults to the midrange of the
longitude coordinates in the map.by.type = TRUE
will make each panel add up to 100.TRUE
a filled circle dot is shown to mark the
receptor point.lattice:levelplot
and cutData
. Similarly, common
axis and title labelling options (such as xlab
,
ylab
, main
) are passed to levelplot
via
quickText
to handle routine formatting.data
) contains the orginal data with the cluster
identified. The second (results
) contains the data used
to plot the clustered trajectories.method = "Angle"
does tend to take much longer
to calculate. Further details of these methods are given in the
openair manual.importTraj
, trajPlot
,
trajLevel
## 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)
## ---------------------------------------------
Run the code above in your browser using DataLab