Learn R Programming

weathermetrics (version 1.2.2)

knots_to_speed: Convert from knots to standard units of wind speed

Description

knots_to_speed creates a numeric vector of speed, in units specified by unit, from a numeric vector of speed in knots.

Usage

knots_to_speed(knots, unit, round = 1)

Arguments

knots
Numeric vector of speeds in knots
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 the specified unit)

Details

Output will be in the speed units specified by unit.

References

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

See Also

speed_to_knots

Examples

Run this code
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

Run the code above in your browser using DataLab