Last chance! 50% off unlimited learning
Sale ends in
polarFreq
primarily plots wind speed-direction
frequencies in polarFreq(mydata, pollutant = "",
statistic = "frequency", ws.int = 1, grid.line = 5,
breaks = seq(0, 5000, 500), cols = "default",
trans = TRUE, type = "default", min.bin = 1,
ws.upper = NA, offset = 10, border.col = "transparent",
key.header = statistic, key.footer = pollutant,
key.position = "right", key = TRUE, auto.text = TRUE,
...)
ws
, wd
and date
.pollutant = "nox"
breaks
expects a sequence of numbers that define
the range of the scale. The sequence could represent one
with equal spacing e.g. breaks = seq(0, 100, 10)
-
a scale from 0-10 in icolours()
to
see the full list). An exampleTRUE
and a square-root transform is applied. This
results in a non-linear scale 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", "ws.int =
10
.offset
controls the size of the
'hole' in the middle and is expressed as a percentage of
the maximum wind speed. Setting a higher offset
e.g. 50 is useful for statistic = "weighted.mean"
when ws.int
key.header = "header", key.footer = "footer"
adds
addition text above and below the scale key. These
arguments are passed to drawOpenKey
via
"top"
, "right"
, "bottom"
and
"left"
.drawOpenKey
. See drawOpenKey
for further
details.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 lattice:xyplot
and cutData
. For example,
polarFreq
passes the option hemisphere =
"southern"
on to cutData
to provide southern
(rather thanpolarFreq
also returns 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 <- polarFreq(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.polarFreq
is its default use provides details of
wind speed and direction frequencies. In this respect it
is similar to windRose
, but considers wind
direction intervals of 10 degrees and a user-specified
wind speed interval. The frequency of wind
speeds/directions formed by these polarFreq
function is more flexible than
either windRose
or polarPlot
.
It can, for example, also consider pollutant
concentrations (see examples below). Instead of the
number of data points in each bin, the concentration can
be shown. Further, a range of statistics can be used to
describe each bin - see statistic
above. Plotting
mean concentrations is useful for source identification
and is the same as polarPlot
but without
smoothing, which may be preferable for some data.
Plotting with statistic = "weighted.mean"
is
particularly useful for understanding the relative
importance of different source contributions. For
example, high mean concentrations may be observed for
high wind speed conditions, but the weighted mean
concentration may well show that the contribution to
overall concentrations is very low.
polarFreq
also offers great flexibility with the
scale used and the user has fine control over both the
range, interval and colour.windRose
,
polarPlot
# basic wind frequency plot
polarFreq(mydata)
# wind frequencies by year
polarFreq(mydata, type = "year")
# mean SO2 by year, showing only bins with at least 2 points
polarFreq(mydata, pollutant = "so2", type = "year", statistic = "mean", min.bin = 2)
# weighted mean SO2 by year, showing only bins with at least 2 points
polarFreq(mydata, pollutant = "so2", type = "year", statistic = "weighted.mean", min.bin = 2)
#windRose for just 2000 and 2003 with different colours
polarFreq(subset(mydata, format(date, "%Y") %in% c(2000, 2003)), type = "year", cols = "jet")
# user defined breaks from 0-700 in intervals of 100 (note linear scale)
polarFreq(mydata, breaks = seq(0, 700, 100))
# more complicated user-defined breaks - useful for highlighting bins with a certain number of data points
polarFreq(mydata, breaks = c(0, 10, 50, 100, 250, 500, 700))
# source contribution plot and use of offset option
polarFreq(mydata, pollutant = "pm25", statistic
="weighted.mean", offset = 50, ws.int = 25, trans = FALSE)
Run the code above in your browser using DataLab