R/mpa_psi.R

Defines functions mpa_psi

Documented in mpa_psi

#' @title
#'  Pounds per square inch to megapascals
#'
#' @family utils
#'
#' @description
#'  Convert pressure (stress) measured in \href{https://en.wikipedia.org/wiki/Pounds_per_square_inch}{pounds per square inch} (PSI)
#'  to \href{https://en.wikipedia.org/wiki/Pascal_(unit)}{megapascals} (MPa)
#'
#' @param x
#'  pressure (stress) measured in \emph{pounds per square inch} (\emph{PSI}).
#'  Type: \code{\link{assert_double}}.
#'
#' @return
#'  pressure (stress) in \emph{megapascals} (\emph{MPa}).
#'  Type: \code{\link{assert_double}}.
#'
#' @seealso
#'  \code{\link{psi_mpa}} for converting \emph{megapascals} to \emph{pounds per square inch}
#'
#' @export
#'
#' @examples
#'  mpa_psi(c(145.03773800721814, 1))
#'  # [1] 1.000000000 0.006894757 # [MPa]
#'
mpa_psi <- function(x) {
  checkmate::assert_double(x, finite = TRUE, any.missing = FALSE)
  6.89475728e-3*x
}

Try the pipenostics package in your browser

Any scripts or data that you put into this service are public.

pipenostics documentation built on March 2, 2021, 5:06 p.m.