make_qty_units_explicit: Make units explicit

View source: R/units.R

make_qty_units_explicitR Documentation

Make units explicit

Description

This function is intended for data frames / tibbles only and makes the specified columns explicit with the target units in the column name.

Usage

make_qty_units_explicit(df, ..., prefix = " [", suffix = "]")

Arguments

df

the data frame in which to make the units explicit

...

named arguments for the columns that should be made explicit and their units, e.g. salt_weight = "mg", salt_concentration = "M".

prefix

the prefix for the units

suffix

the suffix for the units

See Also

Other quantity functions: check_quantities, metric_scaling, quantities, quantity_data, quantity_units

Examples

# data frame with quantities
df <- tibble(x = qty(1:5, "mg"), y = qty(1:5, "L"))
df

# show with explicit units
make_qty_units_explicit(df, x = "mg")
make_qty_units_explicit(df, x = "g", y = "mL")

sebkopf/chemtools documentation built on Aug. 1, 2023, 2:36 a.m.