table_column_attr: Tabulate column attributes

View source: R/utils_data.R

table_column_attrR Documentation

Tabulate column attributes

Description

Tabulate column attributes

Usage

table_column_attr(x, attr = "source", useNA = "always")

Arguments

x

tabular data: Input data set.

attr

Character: Attribute to get

useNA

Character: Passed to table

Value

table.

Author(s)

EDG

Examples

library(data.table)
x <- data.table(
  id = 1:5,
  sbp = rnorm(5, 120, 15),
  dbp = rnorm(5, 80, 10),
  paO2 = rnorm(5, 90, 10),
  paCO2 = rnorm(5, 40, 5)
)
setattr(x[["sbp"]], "source", "outpatient")
setattr(x[["dbp"]], "source", "outpatient")
setattr(x[["paO2"]], "source", "icu")
setattr(x[["paCO2"]], "source", "icu")
table_column_attr(x, "source")

rtemis documentation built on Oct. 20, 2026, 1:06 a.m.