Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

adorn_crosstab

Add presentation formatting to a crosstabulation table.


Description

This function is deprecated, use the adorn_ family of functions instead.

Usage

adorn_crosstab(
  dat,
  denom = "row",
  show_n = TRUE,
  digits = 1,
  show_totals = FALSE,
  rounding = "half to even"
)

Arguments

dat

a data.frame with row names in the first column and numeric values in all other columns. Usually the piped-in result of a call to crosstab that included the argument percent = "none".

denom

the denominator to use for calculating percentages. One of "row", "col", or "all".

show_n

should counts be displayed alongside the percentages?

digits

how many digits should be displayed after the decimal point?

show_totals

display a totals summary? Will be a row, column, or both depending on the value of denom.

rounding

method to use for truncating percentages - either "half to even", the base R default method, or "half up", where 14.5 rounds up to 15.

Value

Returns a data.frame.


janitor

Simple Tools for Examining and Cleaning Dirty Data

v2.1.0
MIT + file LICENSE
Authors
Sam Firke [aut, cre], Bill Denney [ctb], Chris Haid [ctb], Ryan Knight [ctb], Malte Grosser [ctb], Jonathan Zadra [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.