convert_units: Convert all units, regardless of starting and ending units

View source: R/unit-conversions.R

convert_unitsR Documentation

Convert all units, regardless of starting and ending units

Description

Convert all units, regardless of starting and ending units

Usage

convert_units(meas, from_unit, to_unit, conversion_columns = NULL)

Arguments

meas

A measurement in any unit of length

from_unit

A string containing the original unit of measure to be converted

to_unit

A string containing the ending unit of measure

conversion_columns

A vector containing the columns to convert if meas is of type data.frame

Value

The measurement in converted units

Examples

convert_units(1, "in", "cm")
convert_units(100, "cm", "m")

sportyR documentation built on May 29, 2024, 8:33 a.m.