Skip to contents

Function to plot wind speed/direction frequencies and other statistics

Usage

polar_freq(
  data,
  pollutant = NULL,
  statistic = "frequency",
  ws_int = 1,
  wd_nint = 36,
  facet = NULL,
  min_bin = 1,
  border_colour = NA,
  alpha = 1
)

Arguments

data

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

pollutant

A column name identifying pollutant concentration.

statistic

The statistic that should be applied to each wind speed/direction bin. Can be “frequency”, “mean”, “median”, “max” (maximum), “stdev” (standard deviation) or “weighted.mean”. The option “frequency” (the default) is the simplest and plots the frequency of wind speed/direction in different bins. The scale therefore shows the counts in each bin. The option “mean” will plot the mean concentration of a pollutant (see next point) in wind speed/direction bins, and so on. Finally, “weighted.mean” will plot the concentration of a pollutant weighted by wind speed/direction. Each segment therefore provides the percentage overall contribution to the total concentration. More information is given in the examples. Note that for options other than “frequency”, it is necessary to also provide the name of a pollutant. See function cutData for further details.

ws_int

Wind speed interval assumed. In some cases e.g. a low met mast, an interval of 0.5 may be more appropriate.

wd_nint

Number of intervals of wind direction.

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.

min_bin

The minimum number of points allowed in a wind speed/wind direction bin. The default is 1. A value of two requires at least 2 valid records in each bin an so on; bins with less than 2 valid records are set to NA. Care should be taken when using a value > 1 because of the risk of removing real data points.

border_colour

The colour to use for the border of each tile. Defaults to NA, which removes the border.

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_plot(), rose_metbias(), rose_percentile(), rose_pollution(), rose_wind()