Make pivot table

make_pivot_table(
  tbl,
  col1,
  col2,
  show_totals = TRUE,
  show_percentages = c("none", "all", "row", "col"),
  show_chi_test = FALSE,
  theme = c("zebra_blue", "zebra_gold", "tron", "vader", "vanilla", "booktabs",
    "alafoli"),
  tbl_nm = NULL
)

Arguments

tbl

a data frame to pivot

col1

unquoted col 1

col2

unquoted col 2

show_totals

logical; show row and col totals

show_percentages

string; denominator to use when calculating percentages

show_chi_test

logical; show results of chi squared test in footnote

theme

string to choose a predefined theme

tbl_nm

string to name table. If not given, automatically defaults to table name.

Value

a flextable