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

Description Usage Arguments Value Author(s) See Also Examples

View source: R/wdws2uv.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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 Sept. 23, 2018, 5:17 a.m.