Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mixed_units

Create or convert to a mixed units list-column


Description

Create or convert to a mixed units list-column

Usage

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

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

units

Measurement Units for R Vectors

v0.7-1
GPL-2
Authors
Edzer Pebesma [aut, cre] (<https://orcid.org/0000-0001-8049-7069>), Thomas Mailund [aut], Tomasz Kalinowski [aut], James Hiebert [ctb], Iñaki Ucar [aut] (<https://orcid.org/0000-0001-6403-5550>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.