iso_make_units_implicit: Make units implicit

Description Usage Arguments See Also Examples

View source: R/units.R

Description

This function is intended for data frames /tibbles only and tries to figure out which numeric columns have units in the column names and makes those units implicit using iso_double_with_units. The reverse function is iso_make_units_explicit.

Usage

1
iso_make_units_implicit(df, prefix = " [", suffix = "]")

Arguments

df

the data frame in which to make the units implicit/explicit

prefix

the prefix for the units

suffix

the suffix for the units

See Also

Other functions for values with units: iso_get_units(), iso_is_double_with_units(), iso_make_units_explicit(), iso_strip_units(), iso_with_units()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# generate implicit units
df <- tibble(peak = 1:5, `height [V]` = 1:5)
iso_make_units_implicit(df)

# convert back and forth
iso_make_units_implicit(df) %>% iso_make_units_explicit()

# implicit units from custom prefix & suffix
df <- tibble(peak = 1:5, height.V = 1:5)
iso_make_units_implicit(df, prefix = ".", suffix = "")

isoreader documentation built on Nov. 19, 2021, 1:07 a.m.