Learn R Programming

windfarmGA (version 5.0.0)

plot_windrose: Plot a Windrose

Description

Plot a wind rose of the wind data frame.

Usage

plot_windrose(
  data,
  spd,
  dir,
  spdres = 2,
  dirres = 10,
  spdmin = 1,
  spdmax = 30,
  palette = "YlGnBu",
  spdseq = NULL,
  plot = TRUE
)

Value

A ggplot2 wind rose plot, returned invisibly.

Arguments

data

A data.frame containing the wind information

spd

The column of the wind speeds in "data"

dir

The column of the wind directions in "data"

spdres

The increment of the wind speed legend. Default is 2

dirres

The size of the wind sectors. Default is 10

spdmin

Minimum wind speed. Default is 1

spdmax

Maximal wind speed. Default is 30

palette

A color palette used for drawing the wind rose

spdseq

A wind speed sequence, that is used for plotting

plot

Deprecated alias for plot.

See Also

Other Plotting Functions: generation_layouts(), plot_cell_heatmap(), plot_cloud(), plot_development(), plot_evolution(), plot_generation(), plot_parkfitness(), plot_population(), plot_result(), plot_windfarmGA(), population_census(), random_search_single()

Examples

Run this code
## Exemplary Input Wind speed and direction data frame
# Uniform wind speed and single wind direction
data.in <- data.frame(ws = 12, wd = 0)
windrosePlot <- plot_windrose(
  data = data.in, spd = data.in$ws,
  dir = data.in$wd
)

# Random wind speeds and random wind directions
data.in <- data.frame(
  ws = sample(1:25, 10),
  wd = sample(1:260, 10)
)
windrosePlot <- plot_windrose(
  data = data.in, spd = data.in$ws,
  dir = data.in$wd
)

Run the code above in your browser using DataLab