Learn R Programming

compareGroups (version 0.1-3)

varinfo: Variable names and labels extraction

Description

This functions builds and prints a table with the variable names and their labels.

Usage

varinfo(x, ...)
## S3 method for class 'compareGroups':
varinfo(x, ...)

Arguments

x
an object of class 'compareGroups'
...
other arguments currently ignored

Value

  • A 'matrix' with two columns
  • Orig varnameactual variable name in the 'data.frame' or in the 'parent environment'.
  • Shown varnamenames of the variable shown in the resulting tables.

Details

This function is useful when several or all variables are labelled. Then, by default, in the descriptives tables, the labels appear instead of the variable names. It may be necessary to remember the 'original' variable names in a 'quicker way' in order to be easier to modify some options of the analysis or to change some of the variables included in the tables.

See Also

compareGroups, createTable

Examples

Run this code
data(myData)
label(myData$a)<-"variable a"
label(myData$b)<-"variable b"
label(myData$c)<-"variable c"
label(myData$y)<-"grouping variable"
ans<-compareGroups(y~.,data=myData)
createTable(ans)
varinfo(ans)

Run the code above in your browser using DataLab