powered by
This function compute a one or two way contingency table and create a flextable from the result.
The function is largely inspired by "PROC FREQ" from "SAS" and was written with the intent to make it as compact as possible.
proc_freq( x, row = character(), col = character(), include.row_percent = TRUE, include.column_percent = TRUE, include.table_percent = TRUE, weight = character(), ... )
a data.frame object containing variable(s) to use for counts.
data.frame
characer column names for row
characer
characer column names for column
boolean whether to include the row percents; defaults to TRUE
boolean
TRUE
boolean whether to include the column percents; defaults to TRUE
boolean whether to include the table percents; defaults to TRUE
character column name for weight
character
unused arguments
proc_freq(mtcars, "vs", "gear") proc_freq(mtcars, "gear", "vs", weight = "wt")
Run the code above in your browser using DataLab