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

View source: R/wd_convert.R

uv2wdwsR Documentation

convert u and v components to wind direction and wind speed

Description

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

Usage

uv2wdws(u, v)

Arguments

u

a vector of u components

v

a vector of v components

Value

a matrix

Author(s)

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

See Also

wdws2uv

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.