multiVarFreq: Generate a table collapsing frequencies of multiple variables

View source: R/multiVarFreq.R

multiVarFreqR Documentation

Generate a table collapsing frequencies of multiple variables

Description

This function can be used to efficiently combine the frequencies of variables with the same possible values. The frequencies are collapsed into a table with the variable names as row names and the possible values as column (variable) names.

Usage

multiVarFreq(data, items = NULL, labels = NULL, sortByMean = TRUE)

Arguments

data

The dataframe containing the variables.

items

The variable names.

labels

Labels can be provided which will be set as row names when provided.

sortByMean

Whether to sort the rows by mean value for each variable (only sensible if the possible values are numeric).

Value

The resulting dataframe, but with class 'multiVarFreq' prepended to allow pretty printing.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters gjalt-jorn@userfriendlyscience.com

See Also

table()

Examples


multiVarFreq(mtcars, c('gear', 'carb'));


ufs documentation built on May 29, 2024, 10:30 a.m.