windrose: Windrose from the clifro package

View source: R/windrose.R

windroseR Documentation

Windrose from the clifro package

Description

Returns a windrose plot using ggplot2 of wind speed and direction. This function is a wrapper of the clifro::windrose() function.

Usage

windrose(
  data,
  speed,
  direction,
  facet_by = NULL,
  n_directions = 12,
  n_speeds = 5,
  speed_cuts = NA,
  col_pal = "GnBu",
  ggtheme = c("grey", "gray", "bw", "linedraw", "light", "minimal", "classic"),
  legend_title = "Wind Speed",
  calm_wind = 0,
  variable_wind = 990,
  n_col = NULL
)

Arguments

data

data.frame The data.frame to calculate from.

speed

numeric A vector containing wind speeds.

direction

numeric A vector containing wind direction.

facet_by

character(1) Facets used to plot the various windroses.

n_directions

integer(1) The number of direction bins to plot (petals on the rose). The number of directions defaults to 12.

n_speeds

numeric(1) The number of equally spaced wind speed bins to plot. This is used if speed_cuts is NA (default 5).

speed_cuts

numeric A vector containing the cut points for the wind speed intervals, or NA (default)

col_pal

character String indicating the name of the RColorBrewer colour palette to be used for plotting.

ggtheme

character(1) String (partially) matching the ggtheme to be used for plotting.

legend_title

character(1) Legend title.

calm_wind

numeric(1) The upper limit for wind speed that is considered calm (default 0).

variable_wind

numeric(1) Variable winds (if applicable).

n_col

integer(1) The number of columns to plot (default 1).

Value

a ggplot object.

See Also

theme for more possible arguments to pass to windrose.

Examples

# Generate a windrose plot for the daily_niger data
data(daily_niger)
windrose_plot <- windrose(data = daily_niger, speed = "ws", direction = "wd",
                          facet_by = "station_name")

IDEMSInternational/cdms.products documentation built on July 7, 2023, 10:13 a.m.