mixed_units | R Documentation |
Create or convert to a mixed units list-column
mixed_units(x, values, ...)
## S3 replacement method for class 'mixed_units'
units(x) <- value
x |
numeric, or vector of class |
values |
character vector with units encodings, or list with symbolic units of class |
... |
ignored |
value |
see values |
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
.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.