units: Measurement Units

View source: R/units.R

unitsR Documentation

Measurement Units

Description

Assigns or retrieves measurement units assigned to a data object.

Usage

units(x, ...)

Arguments

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.

Details

The units attribute may be erased by assigning a NULL value to it.

Value

An object with a units attribute attached to it.

Functions

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.

See Also

metadata

Examples

x <- data.frame(year = 2010:2014, measurement = rnorm(5))
units(x, "measurement") <- "centimeters"

# Show attributes:
attributes(x)

# Erase 'units' attribute:
units(x) <- NULL


TobieSurette/gulf.metadata documentation built on Dec. 31, 2022, 5:35 a.m.