Creates total, percetage and N to a tabyl format.

adorn_2x2(tabyl)

adorn_ame(
  tabyl,
  where = "col",
  denominator = "row",
  position = "front",
  na.rm = TRUE
)

adorn_tpn(
  tabyl,
  where = "col",
  denominator = "row",
  position = "front",
  na.rm = TRUE
)

Arguments

tabyl

tabyl input

where

(janitor::adorn_totals) one of "row", "col", or c("row", "col")

denominator

(janitor::adorn_percentages) the direction to use for calculating percentages. One of "row", "col", or "all"

position

(from janitor::adorn_ns) should the N go in the "front", or in the "rear", of the percentage?

na.rm

should missing values (including NaN) be omitted from the calculations?

Value

tabyl object with horizontal % and in front N.

Functions

  • adorn_2x2(): DEPRECATED. Creates the usual 2 by 2 output to a tabyl format.

  • adorn_ame(): Creates total, percetage and N to a tabyl format.

  • adorn_tpn(): Creates total, percetage and N to a tabyl format. (same as adorn_ame, but with a formal name)

Examples


if (FALSE) {

library(tidyverse)
library(janitor)
library(avallecam)

mtcars %>%
  tabyl(am,cyl) %>%
  adorn_ame()
mtcars %>%
  tabyl(am,cyl) %>%
  adorn_ame(where = "row")
mtcars %>%
  tabyl(am,cyl) %>%
  adorn_ame(where = "row",denominator = "col")
mtcars %>%
  tabyl(am,cyl) %>%
  adorn_ame(where = c("row","col"),denominator = "col")
mtcars %>%
  tabyl(am,cyl) %>%
  adorn_ame(where = c("row","col"),denominator = "row")

  }