auto_detect_body_title_level: Autodetect the 'title level' of each row in the cross...

Description Usage Arguments Examples

Description

Uses the presence of '(all)' to detect the prominence. The parameter allcount_to_level_translate allows the user to control how the count of '(all)' in the left header is translated into the header level

Usage

1
2
auto_detect_body_title_level(tab, keyword = "(all)",
  allcount_to_level_translate = NULL)

Arguments

tab

a tab object

keyword

The keyword to use to detect summarisation. Uses '(all)' by default because this is what reshape2::dcast uses

allcount_to_level_translate

A named vector that provides a lookup - by default c("0" = NA, "1" = 5, "2" = 4, "3" = 3, "4" = 2, "5" = 1), which says that e.g. allcount 1 results in title_5 etc

Examples

1
2
3
4
crosstab <- read.csv(system.file("extdata", "example_crosstab.csv", package="xltabr"))
tab <- initialise()
tab <- add_body(tab, crosstab, left_header_colnames = c("drive", "age"))
tab <- auto_detect_body_title_level(tab)

xltabr documentation built on May 2, 2019, 9:11 a.m.