Units attribute.

units(x)

units(x) <- value

has.units(x)

Arguments

x

An object.

value

A character specifying the units

Functions

  • units(x) <- value: Set units attribute.

  • has.units(): Check for attribute.

Examples

x <- 1:10
units(x) <- "cm"
has.units(x)
#> [1] TRUE
units(x)
#> [1] "cm"