addWindBarbs: Add wind barbs to a map

View source: R/addWindBarbs.R

addWindBarbsR Documentation

Add wind barbs to a map

Description

Add a multi-sided polygon to a plot.

Usage

addWindBarbs(
  x,
  y,
  speed,
  dir,
  circleSize = 1,
  circleFill = "transparent",
  lineCol = 1,
  extraBarbLength = 0,
  barbSize = 1,
  ...
)

Arguments

x

vector of longitudes

y

vector of latitudes

speed

vector of wind speeds in knots

dir

wind directions in degrees clockwise from north

circleSize

size of the circle

circleFill

circle fill color

lineCol

line color (currently not supported)

extraBarbLength

add length to barbs

barbSize

size of the barb

...

additional arguments to be passed to lines

References

https://commons.wikimedia.org/wiki/Wind_speed

Examples

## Not run: 
library(maps)
library(RAWSmet)

setRawsDataDir("~/Data/RAWS")
cefaMeta <- cefa_loadMeta()

maps::map('state', "washington")

station1 <- cefa_load(nwsID = 451702, meta = cefaMeta) %>% raws_filterDate(20100623, 20100623)
station2 <- cefa_load(nwsID = 452319, meta = cefaMeta) %>% raws_filterDate(20100623, 20100623)

lat <- c(station1$meta$latitude, station2$meta$latitude)
lon <- c(station1$meta$longitude, station2$meta$longitude)
speed <- c(station1$data[1,]$windSpeed, station2$data[1,]$windSpeed)
dir <- c(station1$data[1,]$windDirection, station2$data[1,]$windDirection)

addWindBarbs(lon, lat, speed, dir, lwd = 2)

## End(Not run)


MazamaScience/RAWSmet documentation built on May 6, 2023, 6:57 a.m.