percentileRose
plots percentiles by wind direction
with flexible conditioning. The plot can display mutiple
percentile lines or filled areas.percentileRose(mydata, pollutant = "nox", type = "default",
percentile = c(25, 50, 75, 90, 95), method = "default",
cols = "default", mean = TRUE, mean.lty = 1, mean.lwd = 3,
mean.col = "grey", fill = TRUE, intervals = NULL, angle.scale = 45,
auto.text = TRUE, key.header = NULL, key.footer = "percentile",
key.position = "bottom", key = TRUE, ...)
wd
and a numeric field to plot --- pollutant
.pollutant = "nox"
. More than one
pollutant can be supplied e.g. pollutant = c("no2",
"o3")
provided there is only one t
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. percentile = NA
then only a
mean line will be shown.method = "default"
the supplied
percentiles by wind direction are calculated. When
method = "cpf"
the conditional probability
function (CPF) is plotted and a single (usually high)
percentile level is supplied. The CPRColorBrewer
colours --- see the openair
openColours
funcfill =
FALSE
).intervals = c(0, 10, 30, 50)
angle.scale
to another
value (between 0 and 360 degrees) to mitigTRUE
(default) or
FALSE
. If TRUE
titles and axis labels will
automatically try and format pollutant names and units
properly e.g. by subscripting the key.header
= "header", key.footer = "footer"
adds addition text
above and below the scale key. These arguments are passed
to drawOpenKey
via key.header
."top"
, "right"
, "bottom"
and
"left"
.drawOpenKey
. See drawOpenKey
for further
details.cutData
and lattice:xyplot
. For example,
percentileRose
passes the option hemisphere
= "southern"
on to cutData
to provide southern
(ratherpercentileRose
also returns an object of class
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 <- percentileRose(mydata,
"nox")
, 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
summary
. See openair.generics
for
further details.
percentileRose
calculates percentile levels of a
pollutant and plots them by wind direction. One or more
percentile levels can be calculated and these are displayed
as either filled areas or as lines.The levels by wind direction are calculated using a cyclic smooth cubic spline. The wind directions are rounded to the nearest 10 degrees, consistent with surface data from the UK Met Office before a smooth is fitted.
The percentileRose
function compliments other
similar functions including windRose
,
pollutionRose
, polarFreq
or
polarPlot
. It is most useful for showing the
distribution of concentrations by wind direction and often
can reveal different sources e.g. those that only affect
high percentile concentrations such as a chimney stack.
Similar to other functions, flexible conditioning is
available through the type
option. It is easy for
example to consider multiple percentile values for a
pollutant by season, year and so on. See examples below.
percentileRose
also offers great flexibility with
the scale used and the user has fine control over both the
range, interval and colour.
windRose
,
pollutionRose
, polarFreq
,
polarPlot
# basic percentile plot
percentileRose(mydata, pollutant = "o3")
# 50/95th percentiles of ozone, with different colours
percentileRose(mydata, pollutant = "o3", percentile = c(50, 95), col = "brewer1")
# percentiles of ozone by year, with different colours
percentileRose(mydata, type = "year", pollutant = "o3", col = "brewer1")
# percentile concentrations by season and day/nighttime..
percentileRose(mydata, type = c("season", "daylight"), pollutant = "o3", col = "brewer1")
Run the code above in your browser using DataLab