Learn R Programming

compareGroups (version 4.5.1)

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 compareGroups
varinfo(x, ...)
# S3 method for createTable
varinfo(x, ...)

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.

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).

See Also

compareGroups, createTable

Examples

Run this code
require(compareGroups)
data(regicor)
res<-compareGroups(sex ~ . ,regicor)
#createTable(res, hide.no = 'no')  
varinfo(res)

Run the code above in your browser using DataLab