varinfo {compareGroups} | R Documentation |
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, ...)
## S3 method for class 'createTable'
varinfo(x, ...)
Arguments
x |
an object of class 'compareGroups' or 'createTable' |
... |
other arguments currently ignored |
Details
By default, a compareGroup descriptives table lists variables by label (if one exists) rather than by name. If researchers have assigned detailed labels to their variables, this function is very useful to quickly locate the original variable name if some modification is required. This function simply lists all "Analyzed variable names" by "Orig varname" (i.e. variable name in the data.frame) and "Shown varname" (i.e., label).
Value
A 'matrix' with two columns
Orig varname |
actual variable name in the 'data.frame' or in the 'parent environment'. |
Shown varname |
names of the variable shown in the resulting tables. |
Note
If a variable has no "label" attribute, then the 'original varname' is the same as the 'shown varname'. The first variable in the table corresponds to the grouping variable. To label non-labeled variables or to change the label, specify its "label" attribute..
See Also
Examples
require(compareGroups)
data(regicor)
res<-compareGroups(sex ~ . ,regicor)
#createTable(res, hide.no = 'no')
varinfo(res)