Skip to contents

Function to plot percentiles by wind direction

Usage

rose_percentile(
  data,
  pollutant,
  facet = NULL,
  percentile = c(25, 50, 75, 90, 95),
  method = "default",
  line_lty = 1,
  line_width = 1,
  mean = TRUE,
  mean_lty = 1,
  mean_width = 1,
  mean_colour = "grey",
  alpha = 1
)

Arguments

data

A data frame containing wind direction, wind speed, and pollutant concentrations.

pollutant

One or more column names identifying pollutant concentrations. When multiple pollutants are specified for a single-pollutant statistic (e.g., "mean"), a faceted plot will be returned. Two pollutants must be provided for certain statistic options (e.g., "Pearson" in polar_plot()).

facet

One or two faceting columns. facet determines how the data are split and then plotted. When facet is length 1 it is passed to ggplot2::facet_wrap(), and when it is length 2 it is passed to ggplot2::facet_grid() with the first element being used as columns and the second rows. Some other options (e.g., multiple pollutant columns) can limit the the number of faceting columns to 1.

percentile

The percentile value(s) to plot. Must be between 0--100. If percentile = NA then only a mean line will be shown.

method

When 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 CPF is defined as CPF = my/ny, where my is the number of samples in the wind sector y with mixing ratios greater than the overall percentile concentration, and ny is the total number of samples in the same wind sector (see Ashbaugh et al., 1985).

line_lty

Line type for the percentile lines (see ggplot2::linetype).

line_width

Line width for the percentile lines.

mean

Show the mean by wind direction as a line?

mean_lty

Line type for mean line (see ggplot2::linetype).

mean_width

Line width for mean line.

mean_colour

Line colour for mean line.

alpha

The transparency of the plot. This is mainly useful to overlay it on a map.

See also

Other polar directional analysis functions: polar_annulus(), polar_cluster(), polar_diff(), polar_freq(), polar_plot(), rose_metbias(), rose_pollution(), rose_wind()