convert_temperature: Convert from one temperature metric to another

View source: R/temperature_unit_convertion.R

convert_temperatureR Documentation

Convert from one temperature metric to another

Description

This function allows you to convert a vector of temperature values between Fahrenheit, Celsius, and degrees Kelvin.

Usage

convert_temperature(temperature, old_metric, new_metric)

celsius.to.fahrenheit(T.celsius)

celsius.to.kelvin(T.celsius)

fahrenheit.to.celsius(T.fahrenheit)

fahrenheit.to.kelvin(T.fahrenheit)

kelvin.to.celsius(T.kelvin)

kelvin.to.fahrenheit(T.kelvin)

Arguments

temperature

A numeric vector of temperatures to be converted.

old_metric

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

  • fahrenheit, f

  • kelvin, k

  • celsius, c

new_metric

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

T.kelvin, T.fahrenheit, T.celsius

Numeric vector of temperatures in Kelvin, Fahrenheit and Celsius.

Value

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

A numeric vector of temperature values in the new unit.

Author(s)

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

References

  1. online heat index calculator

  2. online temperature converter


rpkgs/hydroTools documentation built on Oct. 8, 2024, 7:47 p.m.