R/conversions.R

Defines functions tempf2c tempc2f mi2km

Documented in mi2km tempc2f tempf2c

#' Fahrenheit to Celsius
#'
#' @param temp_F
#'
#' @description
#' Converts any temperature in Fahrenheit to the
#' Celcius equivalent. Because, well, life skills.
#'
#' @export
tempf2c <- function(temp_F) {
  temp_C <- (temp_F - 32) * 5 / 9
  return(temp_C)
}

#' Celsius to Fahrenheit
#'
#' @param temp_c
#'
#' @description
#' Converts any temperature in Celcius to the
#' Fahrenheit equivalent. Because, well, life skills.
#'
#' @export
tempc2f <- function(temp_c) {
  temp_f <- temp_c * (9 / 5) + 32
  return(temp_f)
}

#' Title
#'
#' @param miles
#'
#' @description
#' Converts any mile length metric to the
#' kilometer equivalent.
#'
#' @export
mi2km <- function(miles) {
  kilom <- miles * 1.609
  return(kilom)
}
mayagannbociek/nibbler documentation built on Dec. 25, 2019, 5:13 a.m.