Description Usage Arguments Author(s) Examples
View source: R/labelsTemplate.R
Using labels from the label
functions in Hmisc
can be useful in clarifying reports and
making them more readable to investigators. In large data frames, however, it can be tedious to write out the
label(df$var) <- ''
part of the code for every variable. labels.template
prints the necessary code
to the console for a quick copy and paste of all of the variables. Options are provided for sorting the
variable names alphabetically, and for retaining their current values in the template.
1 |
data |
The data frame for which the labels template should be written. |
sort |
Logical. If |
retain.current |
Logical. If |
prefix |
Logical. When |
Benjamin Nutter
1 2 3 4 5 6 7 8 9 10 | library(Hmisc)
mtcars2 <- mtcars # make a copy of mtcars data set
label(mtcars2$am) <- "Automatic Transmission"
label(mtcars2$cyl) <- "Number of Cylinders"
labelsTemplate(mtcars2)
labelsTemplate(mtcars2, sort=TRUE)
labelsTemplate(mtcars2, retain.current=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.