crosstab_percent: Calculate Percents for Contingency Tables

Description Usage Arguments Value

View source: R/crosstab_percent.R

Description

Calculates percents for contingency tables (cross tabulations), by default selects the first n-2 variables (variable n is the number of observations, n-1 is the default omitted column)

Usage

1
crosstab_percent(data_crosstab, n_var = "n", vars = c(), formatted = FALSE)

Arguments

data_crosstab

A contingency table or tibble/data frame of a contingency table

n_var

The name of the variable which contains frequencies

vars

A character vector of variable names

formatted

If "TRUE", percents of frequencies will be a character vector with rounded percents and a percent sign (%), otherwise the raw decimal integers will be returned

Value

A contingency table as a tibble


tonofshell/cowpoke documentation built on June 12, 2020, 8:43 a.m.