Description Usage Arguments Value Author(s) Examples
This function allows you to convert a vector of temperature values between Fahrenheit, Celsius, and degrees Kelvin.
1 | convert_temperature(temperature, old_metric, new_metric, round = 2)
|
temperature |
A numeric vector of temperatures to be converted. |
old_metric |
The metric from which you want to convert. Possible options are:
|
new_metric |
The metric to which you want to convert. The same options
are possible as for |
round |
An integer indicating the number of decimal places to round the converted value. |
A numeric vector with temperature converted to the metric specified
by the argument new_metric
.
#' Joshua Ferreri joshua.m.ferreri@gmail.com, Brooke Anderson brooke.anderson@colostate.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(lyon)
lyon$TemperatureF <- convert_temperature(lyon$TemperatureC,
old_metric = "c", new_metric = "f")
lyon
data(norfolk)
norfolk$TempC <- convert_temperature(norfolk$TemperatureF,
old_metric = "f", new_metric = "c")
norfolk
data(angeles)
angeles$TemperatureC <- convert_temperature(angeles$TemperatureK,
old_metric = "kelvin", new_metric = "celsius")
angeles
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.