units | R Documentation |
Assigns or retrieves measurement units assigned to a data object.
units(x, ...)
x |
Target object. |
... |
Other arguments (not used). |
y |
Character string(s) specifying the name(s) of the variables or attributes to be assigned measurement units. |
value |
Character string(s) specifying the units to be assigned. |
The units
attribute may be erased by assigning a NULL
value to it.
An object with a units
attribute attached to it.
units
Generic units
extraction method.
units.default
Default units
extraction method.
units<-
Generic units
assignment method. See Examples for usage.
units<-.default
Default units
assignment method. See Examples for usage.
metadata
x <- data.frame(year = 2010:2014, measurement = rnorm(5)) units(x, "measurement") <- "centimeters" # Show attributes: attributes(x) # Erase 'units' attribute: units(x) <- NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.