R/convert_weight_to_lbs.R

Defines functions convert_weight_to_lbs

Documented in convert_weight_to_lbs

#' Convert weight to lbs
#' @export
#' @rdname convert_weight_to_kg

convert_weight_to_lbs <- function(weight, weight_units){
  switch(weight_units,
         kg = weight*2.2, kilos = weight*2.2, kilograms = weight*2.2,
         g = weight*2.2/1000, grams = weight*2.2/1000,
         lbs = weight, pounds  = weight,
         stop("invalid units; use kg, g, or lbs"))
}
JMLuther/tabletools documentation built on April 14, 2025, 3:09 a.m.