Add a multi-sided polygon to a plot.
addWindBarbs(
x,
y,
speed,
dir,
circleSize = 1,
circleFill = "transparent",
lineCol = 1,
extraBarbLength = 0,
barbSize = 1,
...
)
vector of longitudes
vector of latitudes
vector of wind speeds in knots
wind directions in degrees clockwise from north
size of the circle
circle fill color
line color (currently not supported)
add length to barbs
size of the barb
additional arguments to be passed to lines
https://commons.wikimedia.org/wiki/Wind_speed
if (FALSE) {
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)
}