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

View source: R/wdws2uv.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

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]) 


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.