temperature_conversion: Convert temperature representations among common units

Description Usage Arguments Value Examples

View source: R/temperature_conversion.R

Description

The function temperature_conversion() converts a numerical representation of temperature among three common units: Fahrenheit, Celsius and Kelvin.

Usage

1
temperature_conversion(input_unit, output_unit, input_temp)

Arguments

input_unit

Unit of the input temperature. The unit should be one of the strings from "C', "K", "F", "Celsius", "Kelvin" and "Fahrenheit".

output_unit

Unit of the output temperature. The unit should also be one of the string from "C', "K", "F", "Celsius", "Kelvin" and "Fahrenheit". Same input and output units are not allowed, and will generate error messages.

input_temp

Input temperature before conversion. The input temperature can come from manual input to the function argument, or it can come from calling on data columns from datasets.

Value

Temperature after conversion that is in the specified output unit.

Examples

1
2
3
temperature_conversion("Celsius", "Kelvin", 50)
temperature_conversion("K", "F", 50)
temperature_conversion("Celsius", "F", 50)

Christina663/temp documentation built on Dec. 17, 2021, 2:03 p.m.