Learn R Programming

rlistings (version 0.2.10)

split_into_pages_by_var: 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)

Value

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

Arguments

lsting

(listing_df)
the listing to split.

var

(string)
name of the variable to split on. If the column is a factor, the resulting list follows the order of the levels.

page_prefix

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

Examples

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

Run the code above in your browser using DataLab