quantities | R Documentation |
Set or retrieve measurement units and uncertainty to/from numeric vectors.
quantities(x)
quantities(x) <- value
set_quantities(x, unit, errors = 0, ...,
mode = units_options("set_units_mode"))
x |
a numeric object, or object of class |
value |
a list of two components: an object of class |
unit |
a |
errors |
a numeric vector of length 1 or the same length as |
... |
passed on to other methods. |
mode |
if |
quantities
returns a named list with the units
and
errors
attributes.
`quantities<-`
sets the units and error values (and converts x
into an object of class quantities
). set_quantities
is a
pipe-friendly version of `quantities<-`
and returns an object of class
quantities
.
errors
, units
, groupGeneric.quantities
.
Extract.quantities
, c.quantities
,
rep.quantities
, cbind.quantities
.
as.data.frame.quantities
, as.matrix.quantities
,
t.quantities
.
x = 1:3
class(x)
x
quantities(x) <- list("m/s", 0.1)
class(x)
x
(x <- set_quantities(x, m/s, seq(0.1, 0.3, 0.1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.