Learn R Programming

descriptr (version 0.1.0)

oway_tables: Multiple One & Two Way Tables

Description

oway_tables creates multiple one way tables by creating a frequency table for each categorical variable in a data frame. tway_tables creates multiple two way tables by creating a cross table for each unique pair of categorical variables in a data frame.

Usage

oway_tables(data)

tway_tables(data)

Arguments

data

a data frame

Details

oway_tables is a extension of the freq_table function. It creates a frequency table for each categorical variable in the dataframe. tway_tables is a extension of the cross_table function. It creates a two way table for each unique pair of categorical variables in the dataframe.

See Also

link{freq_table} link{cross_table}

Examples

Run this code
mt <- mtcars
mt[, c(2, 8, 9)] <- lapply(mt[, c(2, 8, 9)], factor)
# multiple one way tables
oway_tables(mt)

# multiple two way tables
tway_tables(mt)

Run the code above in your browser using DataLab