# Data
df <- data.frame(
cat = c(
"really long thing its so ", "long"
),
value = c(6, 3, 10, 1)
)
fast_afun <- function(x) list("m" = rcell(mean(x), format = "xx."), "m/2" = max(x) / 2)
tbl <- basic_table() %>%
split_rows_by("cat", section_div = "~") %>%
analyze("value", afun = fast_afun, section_div = " ") %>%
build_table(df)
# Getter
section_div(tbl)
# Setter
section_div(tbl) <- letters[seq_len(nrow(tbl))]
tbl
# last letter can appear if there is another table
rbind(tbl, tbl)
# header_section_div
header_section_div(tbl) <- "+"
tbl
Run the code above in your browser using DataLab