split_into_pages_by_var: Split Listing by Values of a Variable

View source: R/rlistings.R

split_into_pages_by_varR Documentation

Split Listing by Values of a Variable

Description

[Experimental]

Split is performed based on unique values of the given parameter present in the listing. Each listing can only be split by variable once. If this function is applied prior to pagination, parameter values will be separated by page.

Usage

split_into_pages_by_var(lsting, var, page_prefix = var)

Arguments

lsting

listing_df. The listing to split.

var

character. Name of the variable to split on.

page_prefix

character. Prefix to be appended with the split value (var level), at the end of the subtitles, corresponding to each resulting list element (listing).

Value

A list of lsting_df objects each corresponding to a unique value of var.

Note

This function should only be used after the complete listing has been created. The listing cannot be modified further after applying this function.

Examples

dat <- ex_adae[1:20, ]

lsting <- as_listing(
  dat,
  key_cols = c("USUBJID", "AGE"),
  disp_cols = "SEX",
  main_title = "title",
  main_footer = "footer"
) %>%
  add_listing_col("BMRKR1", format = "xx.x") %>%
  split_into_pages_by_var("SEX")

lsting


rlistings documentation built on June 22, 2024, 9:17 a.m.