convert_wind_speed: Convert between wind speed metrics

Description Usage Arguments Value Author(s) Examples

Description

This function allows you to convert among the following wind speed metrics: knots, miles per hour, meters per second, feet per second, and kilometers per hour.

Usage

1
convert_wind_speed(wind_speed, old_metric, new_metric, round = 1)

Arguments

wind_speed

A numerical vector of wind speeds to be converted.

old_metric

The metric from which you want to convert. Possible options are:

  • knots: Knots

  • mph: Miles per hour

  • mps: Meters per second

  • ftps: Feet per second

  • kmph: Kilometers per hour

new_metric

The metric to which you want to convert. The same options are possible as for old_metric.

round

An integer indicating the number of decimal places to round the converted value.

Value

A numeric vector with wind speed converted to the metric specified by the argument new_metric.

Author(s)

Joshua Ferreri joshua.m.ferreri@gmail.com, Brooke Anderson brooke.anderson@colostate.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(beijing)
beijing$knots <- convert_wind_speed(beijing$kmph,
   old_metric = "kmph", new_metric = "knots")
beijing

data(foco)
foco$mph <- convert_wind_speed(foco$knots, old_metric = "knots",
   new_metric = "mph", round = 0)
foco$mph <- convert_wind_speed(foco$knots, old_metric = "knots",
   new_metric = "mps", round = NULL)
foco$kmph <- convert_wind_speed(foco$mph, old_metric = "mph",
   new_metric = "kmph")
foco

geanders/weathermetrics documentation built on May 17, 2019, 12:14 a.m.