windRose(mydata, ws = "ws", wd = "wd", ws.int = 2, angle
= 30, type = "default", cols = "default", grid.line =
NULL, width = 1, seg = NULL, auto.text = TRUE, breaks =
4, offset = 10, paddle = TRUE, key.header = NULL,
key.footer = "(m/s)", key.position = "bottom", key =
TRUE, dig.lab = 5, statistic = "prop.count", pollutant
= NULL, annotate = TRUE, ...)
pollutionRose(mydata, pollutant = "nox", key.footer =
pollutant, breaks = 6, paddle = FALSE, seg = 0.9,
key.position = "right", ...)ws
and wdpollutionRose. See breaks
below.width.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", "default, increment, heat,
jet, hue and user defined. For user defined
the user can supply a list of colour names recognised by
R NULL, as in default, this is assigned by
windRose based on the available data range.
However, it can also be forced to a specific value, e.g.
grid.line = 10.paddle = TRUE, the adjustment
factor for width of wind speed intervals. For example,
width = 1.5 will make the paddle width 1.5 times
wider.pollutionRose seg determines
with width of the segments. For example, seg = 0.5
will produce segments 0.5 * angle.TRUE (default) or
FALSE. If TRUE titles and axis labels will
automatically try and format pollutant names and units
properly e.g. by subscripting the `2' in NO2.windRose or pollutant in
pollutionRose. For windRose and the
ws.int default of 2 m/s, the default, 4, generates
the break points 2,TRUE (default) or
FALSE. If TRUE plots rose using `paddle'
style spokes. If FALSE plots rose using `wedge'
style spokes.windRose(mydata, key.header = "ws") adds
the addition text as a scale header. Note: This argument
is passed to drawOpenKeykey.footer."top", "right", "bottom" and
"left".drawOpenKey. See drawOpenKey for further
details.statistic to be applied to
each data bin in the plot. Options currently include
"prop.count", "prop.mean" and
"abs.count". The default "prop.count" sizes
bins according to thwindRose default NULL
is equivalent to pollutant = "ws".TRUE then the percentage calm
and mean values are printed in each panel.pollutionRose other parameters that
are passed on to windRose. For windRose
other parameters that are passed on to
drawOpenKey, lattice:xyplot and
cutData. Axis windRose
and pollutionRose also return an object of class
``openair''. The object includes three main components:
call, the command used to generate the plot;
data, the data frame of summarised information
used to make the plot; and plot, the plot itself.
If retained, e.g. using output <-
windRose(mydata), this output can be used to recover the
data, reproduce or rework the original plot or undertake
further analysis.
An openair output can be manipulated using a number of
generic operations, including print, plot
and summarise. See openair.generics
for further details.
Summarised proportions can also be extracted directly
using the $data operator, e.g. object$data
for output <- windRose(mydata). This returns a
data frame with three set columns: cond,
conditioning based on type; wd, the wind
direction; and calm, the statistic for the
proportion of data unattributed to any specific wind
direction because it was collected under calm conditions;
and then several (one for each range binned for the plot)
columns giving proportions of measurements associated
with each ws or pollutant range plotted as
a discrete panel.windRose data are summarised by direction,
typically by 45 or 30 (or 10) degrees and by different
wind speed categories. Typically, wind speeds are
represented by different width "paddles". The plots show
the proportion (here represented as a percentage) of time
that the wind is from a certain angle and wind speed
range.
By default windRose will plot a windRose in using
"paddle" style segments and placing the scale key below
the plot.
The argument pollutant uses the same plotting
structure but substitutes another data series, defined by
pollutant, for wind speed.
The option statistic = "prop.mean" provides a
measure of the relative contribution of each bin to the
panel mean, and is intended for use with
pollutionRose.
pollutionRose is a windRose wrapper which
brings pollutant forward in the argument list, and
attempts to sensibly rescale break points based on the
pollutant data range by by-passing ws.int.
By default, pollutionRose will plot a pollution
rose of nox using "wedge" style segments and
placing the scale key to the right of the plot.drawOpenKey for fine control of the
scale key.
See polarFreq for a more flexible version
that considers other statistics and pollutant
concentrations.# load example data from package data(mydata)
# basic plot
windRose(mydata)
# one windRose for each year
windRose(mydata,type = "year")
# windRose in 10 degree intervals with gridlines and width adjusted
windRose(mydata, angle = 10, width = 0.2, grid.line = 1)
# pollutionRose of nox
pollutionRose(mydata, pollutant = "nox")
## source apportionment plot - contribution to mean
pollutionRose(mydata, pollutant = "pm10", type = "year", statistic = "prop.mean")Run the code above in your browser using DataLab