R/utils.R

Defines functions mm_to_inch

Documented in mm_to_inch

#' @title Convert millimetres to inches
#'
#' @param x Numeric value in millimetres
#'
#' @return A numerical value in inches
#'
#' @examples mm_to_inch(100)
#'
#' @export

mm_to_inch <- function(x) {

  if (!inherits(x, "numeric")) {
    cli::cli_abort("x must be numeric.")
  }

  x / 25.4

}

Try the sgplot package in your browser

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

sgplot documentation built on June 8, 2025, 12:15 p.m.