vectorsToVelocity: Convert wind vectors to velocity

View source: R/vectorsToVelocity.R

vectorsToVelocityR Documentation

Convert wind vectors to velocity

Description

Converts wind u and v vectors to a single wind velocity. The vectors may be in any units, i.e. km/h or m/s.

Usage

vectorsToVelocity(
  uObs,
  uColnum = 1,
  vObs,
  vColnum = 1,
  quiet = TRUE,
  logfile = ""
)

Arguments

uObs

Required. A CRHMr obs data frame containing the wind u vectors.

uColnum

Optional. The column number containing the u values, not including the datetime. Default is column 1.

vObs

Required. A CRHMr obs data frame containing the wind v vectors. Note that u and v must have the same units!

vColnum

Optional. The column number containing the u values, not including the datetime. Default is column 1.

quiet

Optional. Suppresses display of messages, except for errors. If you are calling this function in an R script, you will usually leave quiet=TRUE (i.e. the default). If you are working interactively, you will probably want to set quiet=FALSE.

logfile

Optional. Name of the file to be used for logging the action. Normally not used

Value

If successful, returns an obs data frame containing the wind speed (in the original vector units) and the wind direction in degrees from North. If unsuccessful, returns the value FALSE.

Author(s)

Kevin Shook

Examples

## Not run: 
windspeed <- vectorsToVelocity(windObs, uColnum=1, uObs, vColnum=2)
## End(Not run)

CentreForHydrology/CRHMr documentation built on April 6, 2024, 5:27 p.m.