Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ggwindrose

Windrose (speed/direction) diagram


Description

Plot a windrose showing the wind speed and direction using ggplot2.

Usage

ggwindrose(
  speed,
  direction,
  n_directions = 8,
  n_speeds = 5,
  speed_cuts = NA,
  col_pal = "GnBu",
  legend_title = "Wind speed (m/s)",
  calm_wind = 0,
  n_col = 1,
  facet,
  plot_title = "",
  ...
)

Arguments

speed

Numeric vector of wind speeds.

direction

Numeric vector of wind directions.

n_directions

Numeric value as the number of direction bins to plot (petals on the rose). The number of directions defaults to 8.

n_speeds

Numeric value as the number of equally spaced wind speed bins to plot. This is used if speed_cuts is NA (default 5).

speed_cuts

Numeric vector containing the cut points for the wind speed intervals, or NA (default).

col_pal

Character string indicating the name of the brewer.pal.info colour palette to be used for plotting, see 'Palette selection' below.

legend_title

Character string to be used for the legend title.

calm_wind

Numeric value as the upper limit for wind speed that is considered calm (default 0).

n_col

The number of columns of plots (default 1).

facet

Character or factor vector of the facets used to plot the various windroses.

plot_title

Character string to be used for the plot title.

...

further arguments passed to theme.

Value

a ggplot object.

Palette selection

Any of the sequential brewer.pal.info colour palettes are recommended for colour plots.

See Also

theme for more possible arguments to pass to ggwindrose.

Examples

## Not run: 
ggwindrose(speed, direction, n_directions = 16,
n_speeds = 7, col_pal = "GnBu", legend_title = "Wind speed (m/s)",
calm_wind = 0, n_col = 1)

## End(Not run)

climaemet

Climate AEMET Tools

v0.2.0
GPL-3
Authors
Manuel Pizarro [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.