Learn R Programming

latbias (version 1.0.0)

windrose: windrose

Description

Plot the directional shifts for a given bootstrap.

Usage

windrose(
  data,
  spd,
  dir,
  spdres = 30,
  dirres = 30,
  spdmin = 0,
  spdmax = 150,
  spdseq = NULL,
  palette = "Spectral",
  countmax = NA,
  debug = 0
)

Value

Windrose plot, ggplot object.

Arguments

data

ddata frame with two columns including the bearing and distance or speed of shifts

spd

distance or speed column

dir

bearing column

spdres

30 by default. Numeric; resolution for plotting distance of speed categories; adapt here the legend and breaks.

dirres

30 by default. Numeric, resolution for plotting bearings on windrose; adapt here the number of bars plotted on the windrose.

spdmin

0 by default. Numeric, minimal distance/speed for plotting.

spdmax

150 by default. Numeric, maximal distance/speed for plotting.

spdseq

NULL

palette

Character string defining the color palette to be used. Available options are taken from rownames(RColorBrewer::brewer.pal.info).

countmax

NA by default. Numeric, optional, adjust the y-axis limit (maximum)

debug

0 by default. Numeric, if >0, run debug to find optimal bins of spd and dir.

Details

This is intended to plot raw simulation output (that is, bearing and distance of random shifts) on a windrose.

References

 Sanczuk et al. submitted.

Examples

Run this code

# \donttest{
study_area <- rnaturalearth::ne_countries(scale = 110, continent = "Europe",
country = "Sweden", type = "map_units", returnclass = "sf")
study_area <- sf::st_union(study_area)
po <- LBI(study_area_id = "Sweden", study_area_polygon = study_area,
nobs = 10, nboot = 10, fact_location = 5, elevation = NULL,
raw_output = TRUE)
test <- as.data.frame(po$all[, c("study_area_id", "distance_km",
"bearing", "rep")])
test$distance_km <- as.numeric(test$distance_km)
pop <- windrose(data = test, spd = "distance_km", dir = "bearing")
# }

Run the code above in your browser using DataLab