Learn R Programming

resourcecode (version 0.5.1)

zmcomp2metconv: Convert u/v to meteorological wind speed and direction

Description

Converts wind or current zonal and meridional velocity components to magnitude and direction according to meteorological convention.

Usage

zmcomp2metconv(u, v = NULL, names = c("wspd", "wdir"))

Value

a Nx2 data.frame with the norm and direction (meteorological convention)

Arguments

u

zonal velocity (1D vector) or matrix with zonal and meridional velocity (Nx2 matrix)

v

meridional velocity (1D vector)

names

names to construct the resulting data.frame

Examples

Run this code
u <- matrix(rnorm(200), nrow = 100, ncol = 2)
vdir <- zmcomp2metconv(u)

Run the code above in your browser using DataLab