make_sas_freq_table: Emulate SAS Frequency Table

Description Usage Arguments Value Examples

View source: R/make_sas_freq_table.R

Description

Main function of proc_freq, used to generate the var1*var2 output tables, with the option to include cell chi-square values. This function is primarily intended to be called within proc_freq, so no error checking is done

Usage

1
make_sas_freq_table(x, cellchi2 = FALSE)

Arguments

x

This is a casted contingency table, generated from data.table::dcast

cellchi2

Boolean value to include cell chi-square values. Default is FALSE

Value

Currently, this just returns a matrix, but when called from proc_freq, it has class sas_table

Examples

1
2
3
4
data(Hawkeye)
ctab <- dcast(Hawkeye, Year ~ Win_Loss, value.var = "Freq")
ctab <- as.matrix(ctab[, 2:3], rownames = ctab[[1]])
make_sas_freq_table(ctab)

collinn/sassyR documentation built on May 1, 2020, 1:59 a.m.