View source: R/percentileRose.R
| percentileRose | R Documentation |
percentileRose() plots percentiles by wind direction with flexible
conditioning. The plot can display multiple percentile lines or filled areas.
percentileRose(
mydata,
pollutant = "nox",
wd = "wd",
type = "default",
percentile = c(25, 50, 75, 90, 95),
smooth = FALSE,
method = "default",
cols = "default",
angle = 10,
mean = TRUE,
mean.lty = 1,
mean.lwd = 3,
mean.col = "grey",
fill = TRUE,
intervals = NULL,
angle.scale = 45,
offset = 0,
auto.text = TRUE,
key.title = NULL,
key.position = "bottom",
strip.position = "top",
plot = TRUE,
key = NULL,
...
)
mydata |
A data frame minimally containing |
pollutant |
Mandatory. A pollutant name corresponding to a variable in a
data frame should be supplied e.g. |
wd |
Name of wind direction field. |
type |
Character string(s) defining how data should be split/conditioned
before plotting.
Most |
percentile |
The percentile value(s) to plot. Must be between 0–100. If
|
smooth |
Should the wind direction data be smoothed using a cyclic spline? |
method |
When |
cols |
Colours to use for plotting. Can be a pre-set palette (e.g.,
|
angle |
Default angle of “spokes” is when |
mean |
Show the mean by wind direction as a line? |
mean.lty |
Line type for mean line. |
mean.lwd |
Line width for mean line. |
mean.col |
Line colour for mean line. |
fill |
Should the percentile intervals be filled (default) or should
lines be drawn ( |
intervals |
User-supplied intervals for the scale e.g. |
angle.scale |
In radial plots (e.g., |
offset |
|
auto.text |
Either |
key.title |
Used to set the title of the legend. The legend title is
passed to |
key.position |
Location where the legend is to be placed. Allowed
arguments include |
strip.position |
Location where the facet 'strips' are located when
using |
plot |
When |
key |
Deprecated; please use |
... |
Addition options are passed on to
|
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 wind directions are rounded to the nearest 10 degrees, consistent with
surface data from the UK Met Office before a smooth is fitted. The levels by
wind direction are optionally calculated using a cyclic smooth cubic spline
using the option smooth. If smooth = FALSE then the data are shown in 10
degree sectors.
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.
an openair object
David Carslaw
Jack Davison
Ashbaugh, L.L., Malm, W.C., Sadeh, W.Z., 1985. A residence time probability analysis of sulfur concentrations at ground canyon national park. Atmospheric Environment 19 (8), 1263-1270.
Other polar directional analysis functions:
polarAnnulus(),
polarCluster(),
polarDiff(),
polarFreq(),
polarPlot(),
pollutionRose(),
windRose()
# 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")
## Not run:
# percentiles of ozone by year, with different colours
percentileRose(
mydata,
type = "year",
pollutant = "o3",
col = "brewer1",
layout = c(4, 2)
)
# percentile concentrations by season and day/nighttime..
percentileRose(
mydata,
type = c("daylight", "season"),
pollutant = "o3",
col = "brewer1"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.