Learn R Programming

rtables (version 0.6.12)

append_topleft: Append a description to the 'top-left' materials for the layout

Description

This function adds newlines to the current set of "top-left materials".

Usage

append_topleft(lyt, newlines)

Value

A PreDataTableLayouts object suitable for passing to further layouting functions, and to build_table().

Arguments

lyt

(PreDataTableLayouts)
layout object pre-data used for tabulation.

newlines

(character)
the new line(s) to be added to the materials.

Details

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.

See Also

top_left()

Examples

Run this code
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

Run the code above in your browser using DataLab