plot_windrose: Wind rose plot

Description Usage Arguments Details Value Examples

View source: R/data_visualisation.R

Description

Plot a wind rose diagram, showing the relative frequency of winds coming from each point of the compass

Usage

1
2
3
plot_windrose(data, speed, direction, spdres = 2, dirres = 30,
  spdmin = 2, spdmax = 20, spdseq = NULL, palette = "YlGnBu",
  countmax = NA, printplot = TRUE)

Arguments

data

A data frame containing wind speed and direction in degrees

speed

The name of the column in the data frame containing wind speed

direction

The name of the column in the data frame containing wind direction

spdres

Resolution of wind speed bins

dirres

Resolution of wind direction bins

spdmin

Maximum wind speed to use in binning

spdmax

Minimum wind speed to use in binning

palette

Palette to use in plotting

countmax

Maximum axis limit for plotting

Details

Radar plot code modified from answers to this Stackoverflow question: https://stackoverflow.com/questions/9614433/creating-radar-chart-a-k-a-star-plot-spider-plot-using-ggplot2-in-r/10820387

Value

A ggplot2 object containing the windrose plot

Examples

1
2
3
4
5
# Assuming EasyWeather data files called 2018.csv and 2019.csv are in local
# directory:
years <- c(2018,2019)
test_data <- merge_years(years)
p <- plot_windrose(test_data, "wind_km_h", "wind_direction_deg", dirres = 15)

clarelindeque/EasyWeatherR documentation built on May 14, 2019, 3:06 a.m.