extractlabs | R Documentation |
Extract Labels and Units From Multiple Datasets
extractlabs(..., print = TRUE)
... |
one ore more data frames or data tables |
print |
set to |
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.
a data table
Frank Harrell
label()
, contents()
, units()
, hlab()
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.