knots_to_speed {weathermetrics} | R Documentation |
knots_to_speed
creates a numeric vector of speed, in units
specified by unit
, from a numeric vector of speed in knots.
knots_to_speed(knots, unit, round = 1)
knots |
Numeric vector of speeds in knots |
unit |
Character specifying the speed unit other than knots. Possible values are:
|
round |
An integer indicating the number of decimal places to round the converted value. |
Output will be in the speed units specified by unit
.
A numeric vector of speeds (in the specified unit)
Equations are from the source code for the National Oceanic and and Atmospheric Administration's online wind speed converter
Joshua Ferreri joshua.m.ferreri@gmail.com, Brooke Anderson brooke.anderson@colostate.edu
http://www.srh.noaa.gov/epz/?n=wxcalc_windconvert
data(foco)
foco$mph <- knots_to_speed(foco$knots, unit = "mph", round = 0)
foco$mps <- knots_to_speed(foco$knots, unit = "mps", round = NULL)
foco$ftps <- knots_to_speed(foco$knots, unit = "ftps")
foco$kmph <- knots_to_speed(foco$knots, unit = "kmph")
foco