convert.temp: Converting Temperatures

Description Usage Arguments Details Value Examples

View source: R/tempconv.r

Description

Converts temperatures temperatures between degrees Celsius, degrees Fahrenheit and Kelvin.

Usage

1
2
convert.temp(from.temp, from.unit = "Celsius", to.unit = "Kelvin",
  as.json = FALSE)

Arguments

from.temp

Temperature value to be converted.

from.unit

Scale of the temperature value to be converted. Either "Celsius" (default), "Fahrenheit" or "Kelvin".

to.unit

Target temperature scale. Either "Celsius" (default), "Fahrenheit" or "Kelvin".

as.json

Indicates if function returns JSON object describing the conversion instead of just the converted temperature value.

Details

If as.json==TRUE then convert.temp() returns a JSON object containing two sub-object from and to each of which has a temp and a unit field to describe the temperature. The from.unit and to.unit arguments are case-insensitive.

Value

Either the converted temperature value or a JSON object (see details).

Examples

1
2
result.fahrh.json <- convert.temp(24.5, from.unit="celsius", to.unit="fahrenheit", as.json=TRUE)
result.kelv <- convert.temp(24.5)

jsugarelli/tempconvertr documentation built on March 9, 2020, 12:15 a.m.