extractlabs: extractlabs

View source: R/hlab.r

extractlabsR Documentation

extractlabs

Description

Extract Labels and Units From Multiple Datasets

Usage

extractlabs(..., print = TRUE)

Arguments

...

one ore more data frames or data tables

print

set to FALSE to not print details about variables with conflicting attributes

Details

For one or more data frames/tables extracts all labels and units and comb ines them over dataset, dropping any variables not having either labels or units defined. The resulting data table is returned and is used by the hlab function if the user stores the result in an objectnamed LabelsUnits. The result is NULL if no variable in any dataset has a non-blank label or units. Variables found in more than one dataset with duplicate label and units are consolidated. A warning message is issued when duplicate variables have conflicting labels or units, and by default, details are printed. No attempt is made to resolve these conflicts.

Value

a data table

Author(s)

Frank Harrell

See Also

label(), contents(), units(), hlab()

Examples

d <- data.frame(x=1:10, y=(1:10)/10)
d <- upData(d, labels=c(x='X', y='Y'), units=c(x='mmHg'), print=FALSE)
d2 <- d
units(d2$x) <- 'cm'
LabelsUnits <- extractlabs(d, d2)
LabelsUnits

Hmisc documentation built on Sept. 12, 2023, 5:06 p.m.