wdws2uv: convert wind direction and wind speed to u and v components

View source: R/wd_convert.R

wdws2uvR Documentation

convert wind direction and wind speed to u and v components

Description

this function converts wind direction and wind speed to u and v components

Usage

wdws2uv(wd, ws)

Arguments

wd

a vector of wind directions

ws

a vector of wind speeds

Value

a matrix

Author(s)

Tim Appelhans https://raw.githubusercontent.com/environmentalinformatics-marburg/Rsenal/master/R/wdws2uv.R

See Also

uv2wdws

Examples

set.seed(123)
wd <- as.integer(rnorm(10, 180, 90))

set.seed(123)
ws <- rnorm(10, 4, 1)

## convert to u and v
wdws2uv(wd, ws)

## convert back
uv <- wdws2uv(wd, ws)
uv2wdws(uv[, 1], uv[, 2])


maxbre/rfunctions documentation built on Nov. 19, 2022, 5:46 p.m.