powered by
This function compute a two way contingency table and make a flextable with the result.
proc_freq( x, row, col, main = "", include.row_percent = TRUE, include.column_percent = TRUE, include.table_percent = TRUE, include.column_total = TRUE, include.row_total = TRUE, include.header_row = TRUE, weight = NULL )
data.frame object
data.frame
characer column names for row
characer
characer column names for column
characer title
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
boolean whether to include the row of column totals; defaults to TRUE
boolean whether to include the column of row totals; defaults to TRUE
boolean whether to include the header row; defaults to TRUE
character column name for weight
character
Titouan Robert
proc_freq(mtcars, "vs", "gear") proc_freq(mtcars, "gear", "vs") proc_freq(mtcars, "gear", "vs", weight = "wt") proc_freq(mtcars, "gear", "vs", "My title")
Run the code above in your browser using DataLab