View source: R/colby_constructors.R
append_topleft | R Documentation |
This function adds newlines
to the current set of "top-left materials".
append_topleft(lyt, newlines)
lyt |
( |
newlines |
( |
Adds newlines
to the set of strings representing the 'top-left' materials declared in the layout (the content
displayed to the left of the column labels when the resulting tables are printed).
Top-left material strings are stored and then displayed exactly as is, no structure or indenting is applied to them either when they are added or when they are displayed.
A PreDataTableLayouts
object suitable for passing to further layouting functions, and to build_table()
.
Currently, where in the construction of the layout this is called makes no difference, as it is independent of the actual splitting keywords. This may change in the future.
This function is experimental, its name and the details of its behavior are subject to change in future versions.
top_left()
library(dplyr)
DM2 <- DM %>% mutate(RACE = factor(RACE), SEX = factor(SEX))
lyt <- basic_table() %>%
split_cols_by("ARM") %>%
split_cols_by("SEX") %>%
split_rows_by("RACE") %>%
append_topleft("Ethnicity") %>%
analyze("AGE") %>%
append_topleft(" Age")
tbl <- build_table(lyt, DM2)
tbl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.