The traditional wind rose plot that plots wind speed and wind direction by different intervals. The pollution rose applies the same plot structure but substitutes other measurements, most commonly a pollutant time series, for wind speed.
Usage
windRose(
mydata,
ws = "ws",
wd = "wd",
ws2 = NA,
wd2 = NA,
ws.int = 2,
angle = 30,
type = "default",
calm.thresh = 0,
bias.corr = TRUE,
cols = "default",
grid.line = NULL,
width = 0.9,
seg = 0.9,
auto.text = TRUE,
breaks = 4,
offset = 10,
normalise = FALSE,
max.freq = NULL,
paddle = TRUE,
key.title = "(m/s)",
key.position = "bottom",
strip.position = "top",
dig.lab = 5,
include.lowest = FALSE,
statistic = "prop.count",
pollutant = NULL,
annotate = TRUE,
angle.scale = 315,
border = NA,
plot = TRUE,
key = NULL,
...
)Arguments
- mydata
A data frame containing fields
wsandwd- ws
Name of the column representing wind speed.
- wd
Name of the column representing wind direction.
- ws2, wd2
The user can supply a second set of wind speed and wind direction values with which the first can be compared. See
pollutionRose()for more details.- ws.int
The Wind speed interval. Default is 2 m/s but for low met masts with low mean wind speeds a value of 1 or 0.5 m/s may be better.
- angle
Default angle of “spokes” is 30. Other potentially useful angles are 45 and 10. Note that the width of the wind speed interval may need adjusting using
width.- type
Character string(s) defining how data should be split/conditioned before plotting.
"default"produces a single panel using the entire dataset. Any other options will split the plot into different panels - a roughly square grid of panels if onetypeis given, or a 2D matrix of panels if twotypesare given.typeis always passed tocutData(), and can therefore be any of:A built-in type defined in
cutData()(e.g.,"season","year","weekday", etc.). For example,type = "season"will split the plot into four panels, one for each season.The name of a numeric column in
mydata, which will be split inton.levelsquantiles (defaulting to 4).The name of a character or factor column in
mydata, which will be used as-is. Commonly this could be a variable like"site"to ensure data from different monitoring sites are handled and presented separately. It could equally be any arbitrary column created by the user (e.g., whether a nearby possible pollutant source is active or not).
Most
openairplotting functions can take twotypearguments. If two are given, the first is used for the columns and the second for the rows.- calm.thresh
By default, conditions are considered to be calm when the wind speed is zero. The user can set a different threshold for calms be setting
calm.threshto a higher value. For example,calm.thresh = 0.5will identify wind speeds below 0.5 as calm.- bias.corr
When
angledoes not divide exactly into 360 a bias is introduced in the frequencies when the wind direction is already supplied rounded to the nearest 10 degrees, as is often the case. For example, ifangle = 22.5, N, E, S, W will include 3 wind sectors and all other angles will be two. A bias correction can made to correct for this problem. A simple method according to Applequist (2012) is used to adjust the frequencies.- cols
Colours to use for plotting. Can be a pre-set palette (e.g.,
"turbo","viridis","tol","Dark2", etc.) or a user-defined vector of R colours (e.g.,c("yellow", "green", "blue", "black")- seecolours()for a full list) or hex-codes (e.g.,c("#30123B", "#9CF649", "#7A0403")). Alternatively, can be a list of arguments to control the colour palette more closely (e.g.,palette,direction,alpha, etc.). SeeopenColours()andcolourOpts()for more details.- grid.line
Grid line interval to use. If
NULL, as in default, this is assigned based on the available data range. However, it can also be forced to a specific value, e.g.grid.line = 10.grid.linecan also be a list to control the interval, line type and colour. For examplegrid.line = list(value = 10, lty = 5, col = "purple").- width
For 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.
- seg
segdetermines with width of the segments. For example,seg = 0.5will produce segments 0.5 *angle.- auto.text
Either
TRUE(default) orFALSE. IfTRUEtitles and axis labels will automatically try and format pollutant names and units properly, e.g., by subscripting the "2" in "NO2". Passed toquickText().- breaks
Most commonly, the number of break points for wind speed. With the
ws.intdefault of 2 m/s, thebreaksdefault, 4, generates the break points 2, 4, 6, 8 m/s. However,breakscan also be used to set specific break points. For example, the argumentbreaks = c(0, 1, 10, 100)breaks the data into segments <1, 1-10, 10-100, >100.- offset
offsetcontrols the size of the 'hole' in the middle and is expressed on a scale of0to100, where0is no hole and100is a hole that takes up the entire plotting area.- normalise
If
TRUEeach wind direction segment is normalised to equal one. This is useful for showing how the concentrations (or other parameters) contribute to each wind sector when the proportion of time the wind is from that direction is low. A line showing the probability that the wind directions is from a particular wind sector is also shown.- max.freq
Controls the scaling used by setting the maximum value for the radial limits. This is useful to ensure several plots use the same radial limits.
- paddle
Either
TRUEorFALSE. IfTRUEplots rose using 'paddle' style spokes. IfFALSEplots rose using 'wedge' style spokes.- key.title
Used to set the title of the legend. The legend title is passed to
quickText()ifauto.text = TRUE.- key.position
Location where the legend is to be placed. Allowed arguments include
"top","right","bottom","left"and"none", the last of which removes the legend entirely.- strip.position
Location where the facet 'strips' are located when using
type. When onetypeis provided, can be one of"left","right","bottom"or"top". When twotypes are provided, this argument defines whether the strips are "switched" and can take either"x","y", or"both". For example,"x"will switch the 'top' strip locations to the bottom of the plot.- dig.lab
The number of significant figures at which scientific number formatting is used in break point and key labelling. Default 5.
- include.lowest
Logical. If
FALSE(the default), the first interval will be left exclusive and right inclusive. IfTRUE, the first interval will be left and right inclusive. Passed to theinclude.lowestargument ofcut().- statistic
The
statisticto 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 the proportion of the frequency of measurements. Similarly, “prop.mean” sizes bins according to their relative contribution to the mean. “abs.count” provides the absolute count of measurements in each bin.- pollutant
Alternative data series to be sampled instead of wind speed. The
windRose()default NULL is equivalent topollutant = "ws". Use inpollutionRose().- annotate
If
TRUEthen the percentage calm and mean values are printed in each panel together with a description of the statistic below the plot. IfFALSEthen only the statistic will be printed.- angle.scale
In radial plots (e.g.,
polarPlot()), the radial scale is drawn directly on the plot itself. While suitable defaults have been chosen, sometimes the placement of the scale may interfere with an interesting feature.angle.scalecan take any value between0and360to place the scale at a different angle, orFALSEto move it to the side of the plots.- border
Border colour for shaded areas. Default is no border.
- plot
When
openairplots are created they are automatically printed to the active graphics device.plot = FALSEdeactivates this behaviour. This may be useful when the plot data is of more interest, or the plot is required to appear later (e.g., later in a Quarto document, or to be saved to a file).- key
Deprecated; please use
key.position. IfFALSE, setskey.positionto"none".- ...
Addition options are passed on to
cutData()fortypehandling. Some additional arguments are also available, varying somewhat in different plotting functions:title,subtitle,caption,tag,xlabandylabcontrol the plot title, subtitle, caption, tag, x-axis label and y-axis label. All of these are passed through toquickText()ifauto.text = TRUE.xlim,ylimandlimitscontrol the limits of the x-axis, y-axis and colorbar scales.ncolandnrowset the number of columns and rows in a faceted plot.fontsizeoverrides the overall font size of the plot by setting thetextargument ofggplot2::theme(). It may also be applied proportionately to anyopenairannotations (e.g., N/E/S/W labels on polar coordinate plots).Various graphical parameters are also supported:
linewidth,linetype,shape,size,border, andalpha. Not all parameters apply to all plots. These can take a single value, or a vector of multiple values - e.g.,shape = c(1, 2)- which will be recycled to the length of values needed.lineend,linejoinandlinemitretweak the appearance of line plots; seeggplot2::geom_line()for more information.In polar coordinate plots,
annotate = FALSEwill remove the N/E/S/W labels and any other annotations.
Value
an openair object. Summarised proportions can 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.
Details
For 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. It is
recommended to use pollutionRose() for plotting pollutant concentrations.
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.
References
Applequist, S, 2012: Wind Rose Bias Correction. J. Appl. Meteor. Climatol., 51, 1305-1309.
Droppo, J.G. and B.A. Napier (2008) Wind Direction Bias in Generating Wind Roses and Conducting Sector-Based Air Dispersion Modeling, Journal of the Air & Waste Management Association, 58:7, 913-918.
See also
Other polar directional analysis functions:
percentileRose(),
polarAnnulus(),
polarCluster(),
polarDiff(),
polarFreq(),
polarPlot(),
pollutionRose()


