mixed_units: Create or convert to a mixed units list-column

Description Usage Arguments Details Examples

View source: R/mixed.R

Description

Create or convert to a mixed units list-column

Usage

1
2
3
4
mixed_units(x, values, ...)

## S3 replacement method for class 'mixed_units'
units(x) <- value

Arguments

x

numeric, or vector of class units

values

character vector with units encodings, or list with symbolic units of class mixed_symbolic_units

...

ignored

value

see values

Details

if x is of class units, values should be missing or of class mixed_symbolic_units; if x is numeric, values should be a character vector the length of x.

Examples

1
2
3
4
5
a <- 1:4
u <- c("m/s", "km/h", "mg/L", "g")
mixed_units(a, u)
units(a) = as_units("m/s")
mixed_units(a) # converts to mixed representation

r-quantities/units documentation built on Nov. 6, 2019, 11:44 a.m.