Skip to contents

r8columns() describes the columns of a value of a table type (new_table_type()), and r8annotate() gives a value with the units or the descriptions of columns that its type does not declare. Those of a declared column are its type's. A column that is replaced has neither.

Usage

r8columns(x)

r8annotate(x, unit = NULL, description = NULL)

Arguments

x

A value of a table.

unit, description

Optional named character: The units, UCUM codes by convention, and the descriptions, by the names of columns; NA removes one.

Value

r8columns(), a data frame with the variables name, type, unit, description, and declared. r8annotate(), the new value.

Examples

r <- Raven(age = c(40, 52), sex = c("f", "m"))
r <- r8annotate(
  r,
  unit = c(age = "a"),
  description = c(age = "Age at admission")
)
r
#> <raven table> 2 rows ⨉ 2 columns
#>       age  sex
#>    double  character
#>       [a]
#> 1      40  f
#> 2      52  m
r8columns(r)
#>   name      type unit      description declared
#> 1  age    double    a Age at admission    FALSE
#> 2  sex character <NA>             <NA>    FALSE