Learn R Programming

openair (version 0.3-8)

windRose: Traditional windRose plot and pollutionRose variation

Description

The traditional windRose plot that plots wind speed and wind direction by different intervals. The pollutionRose applies the same plot structure but substitutes other measurements, most commonly a pollutant time series, for wind speed.

Usage

windRose(polar,
    ws.int = 2, angle = 30, type = "default", 
    cols = "default", main = "", grid.line = 5,
    width = 1, auto.text = TRUE, breaks = 4, paddle = TRUE,
    key.header = NULL, key.footer = "(m/s)",
    key.position = "bottom", key = NULL, dig.lab = 5,
    pollutant = NULL, output = "graph",
    ...)

ans <- windRose(...)

pollutionRose(polar, 
    pollutant = "nox",
    key.footer = pollutant,
    breaks = 6, paddle = FALSE,
    key.position = "right",
    ...)

ans <- pollutionRose(...)

Arguments

polar
A data frame containing fields ws and wd
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. Note, this argument is superceded in pollutionRose. See breaks below.
breaks
The number of break points produced for wind speed in windRose or pollutant in pollutionRose. For windRose and the ws.int default of 2 m/s, the default, 4, generates the break points 2, 4, 6, 8
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
Default is default, which will plot all data on one windRose. Other useful options are year, month and hour for one windRose for each year or each month respectfully. Many more types are shown i
cols
Colours to be used for plotting. Options include default, increment, heat, jet, hue and user defined. For user defined the user can supply a list of colour names recognised by R (ty
main
Title of plot.
grid.line
Grid line interval to use.
paddle
Either TRUE (default) or FALSE. If TRUE plots rose using `paddle' style spokes. If FALSE plots rose using `wedge' style spokes.
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.
auto.text
Either 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.
key.header, key.footer
Adds additional text/labels above and/or below the scale key, respectively. For example, passing windRose(mydata, key.header = "ws") adds the addition text as a scale header. Note: This argument is passed to drawOpenKey<
key.position
Location where the scale key is to plotted. Allowed arguments currently include "top", "right", "bottom" and "left".
key
Fine control of the scale key via drawOpenKey. See drawOpenKey for further details.
dig.lab
The number of signficant figures at which scientific number formatting is used in break point and key labelling. Default 5.
pollutant
Alternative data series to be sampled instead of wind speed. The windRose default NULL is equivalent to pollutant = "ws".
output
The type of output returned by call. Default, graph, returns the rose plot itself. Alternative, data, plots the rose but returns the plot data frame.
...
For pollutionRose other parameters that are passed on to windRose. For windRose other parameters that are passed on to drawOpenKey and lattice:xyplot.

Warnings

Note that windRose and pollutionRose are designed to work with UK Met Office files. Wind directions of 0 degrees are assumed to be calms. The function will assume any data with wind speed = 0 or wind direction = 0 will be calm. Note that windRose and pollutionRose both use drawOpenKey to produce scale keys.

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 substiutes another data series, defined by pollutant, for wind speed. 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 pollutionRose of nox using "wedge" style segments and placing the scale key to the right of the plot.

See Also

See drawOpenKey for fine control of the scale key. See polarFreq for a more flexible version that considers other statistics and pollutant concentrations.

Examples

Run this code
# 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.3, grid.line = 1)

# pollutionRose of nox
pollutionRose(mydata, pollutant = "nox")

Run the code above in your browser using DataLab