Learn R Programming

weathermetrics (version 1.2.2)

speed_to_knots: Convert between standard units of measure for wind speed

Description

speed_to_knots creates a numeric vector of speed in knots from a numeric vector of speed in the specified unit.

Usage

speed_to_knots(x, unit, round = 1)

Arguments

x
Numeric vector of wind speeds, in units specified by unit
unit
Character specifying the speed unit other than knots. Possible values are:
  • mph: Miles per hour
  • mps: Meters per second
  • ftps: Feet per second
  • kmph: Kilometers per hour
round
An integer indicating the number of decimal places to round the converted value.

Value

A numeric vector of speeds (in knots)

References

http://www.srh.noaa.gov/epz/?n=wxcalc_windconvert

See Also

knots_to_speed

Examples

Run this code
data(beijing)
beijing$knots <- speed_to_knots(beijing$kmph, unit = "kmph", round = 2)
beijing

Run the code above in your browser using DataLab