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
)
tabyl input
(janitor::adorn_totals) one of "row", "col", or c("row", "col")
(janitor::adorn_percentages) the direction to use for calculating percentages. One of "row", "col", or "all"
(from janitor::adorn_ns) should the N go in the "front", or in the "rear", of the percentage?
should missing values (including NaN) be omitted from the calculations?
tabyl object with horizontal % and in front N.
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)
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")
}