| Title: | Subject-Level Analysis Using 'metalite' | 
| Version: | 0.1.1 | 
| Description: | Analyzes subject-level data in clinical trials using the 'metalite' data structure. The package simplifies the workflow to create production-ready tables, listings, and figures discussed in the subject-level analysis chapters of "R for Clinical Study Reports and Submission" by Zhang et al. (2022) https://r4csr.org/. | 
| Depends: | R (≥ 4.1.0) | 
| License: | GPL (≥ 3) | 
| Imports: | glue, metalite, metalite.ae, r2rtf, reactable, stringr, rlang, plotly, htmltools, brew, uuid | 
| Suggests: | dplyr, knitr, testthat (≥ 3.0.0), tidyr | 
| VignetteBuilder: | knitr | 
| Encoding: | UTF-8 | 
| RoxygenNote: | 7.3.2 | 
| Config/testthat/edition: | 3 | 
| NeedsCompilation: | no | 
| Packaged: | 2025-05-08 23:34:17 UTC; fukuhiro | 
| Author: | Benjamin Wang [aut, cre], Yujie Zhao [aut], Hiroaki Fukuda [aut], PoYao Niu [aut], Nan Xiao [aut], Jeetener Chauhan [ctb], Li Ma [ctb], Chen Wang [ctb], Merck Sharp & Dohme Corp [cph] | 
| Maintainer: | Benjamin Wang <benjamin.wang@merck.com> | 
| Repository: | CRAN | 
| Date/Publication: | 2025-05-09 02:50:02 UTC | 
Count number of subjects
Description
Count number of subjects
Usage
collect_baseline(
  meta,
  population,
  parameter,
  type = "Subjects",
  use_na = c("ifany", "no", "always"),
  display_total = TRUE
)
Arguments
| meta | A metadata object created by metalite. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
| type | A character value to control title name, e.g., Subjects or Records. | 
| use_na | A character value for whether to include  | 
| display_total | A logical value to display total column. | 
Value
A list containing number of subjects
Examples
meta <- meta_sl_example()
meta |> collect_baseline(
  population = "apat",
  parameter = "age"
)
Deformat percent
Description
Deformat percent
Usage
defmt_pct(pct)
Arguments
| pct | string eager to remove percent | 
Value
Numeric value without percent
Examples
defmt_pct("10.0%")
defmt_pct(c("10.0%", "(11.2%)"))
Add cumulative count and summary stats for categories for exposure duration analysis
Description
Add cumulative count and summary stats for categories for exposure duration analysis
Usage
extend_exp_duration(
  outdata,
  category_section_label = paste0(metalite::collect_adam_mapping(outdata$meta,
    outdata$parameter)$label, " (extend)"),
  duration_category_list = extract_duration_category_ranges(duration_category_labels),
  duration_category_labels =
    levels(outdata$meta$data_population[[metalite::collect_adam_mapping(outdata$meta,
    outdata$parameter)$vargroup]])
)
Arguments
| outdata | An  | 
| category_section_label | A character value of section label.
If  | 
| duration_category_list | A list of duration category ranges.
Must be real numbers and may overlap or be mutually exclusive.
A list should be in the form of  | 
| duration_category_labels | A character vector of internal labels. Labels to be displayed for the duration_category_list values. Must be the same length as duration_category_list. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_exposure_example()
outdata <- meta |> prepare_exp_duration()
outdata |>
  extend_exp_duration(
    duration_category_list = list(c(1, NA), c(7, NA), c(28, NA), c(12 * 7, NA), c(24 * 7, NA)),
    duration_category_labels = c(">=1 day", ">=7 days", ">=28 days", ">=12 weeks", ">=24 weeks")
  )
Format Baseline Characteristics Analysis
Description
Format Baseline Characteristics Analysis
Usage
format_base_char(
  outdata,
  display_col = c("n", "prop", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)
Arguments
| outdata | A metadata object created by  | 
| display_col | Column wants to display on the table.
The term could be selected from  | 
| digits_prop | Number of digits for proportion columns. | 
| display_stat | A vector of statistics term name.
The term name could be selected from
 | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_base_char(population = "apat", parameter = "age;gender") |>
  format_base_char()
Prepare data for Subgroup Analysis for Baseline Characteristic
Description
Prepare data for Subgroup Analysis for Baseline Characteristic
Usage
format_base_char_subgroup(
  outdata,
  display = c("n", "prop", "total"),
  display_stat = c("mean", "sd", "median", "range"),
  display_total = TRUE
)
Arguments
| outdata | A metadata object created by  | 
| display | Column wants to display on the table.
The term could be selected from  | 
| display_stat | A vector of statistics term name.
The term name could be selected from
 | 
| display_total | A logic value of displaying the total column for the second level header. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
outdata <- prepare_base_char_subgroup(
  meta,
  population = "apat",
  parameter = "age",
  subgroup_var = "TRTA",
  subgroup_header = c("SEX", "TRTA")
)
outdata |> format_base_char_subgroup()
Format Disposition Analysis
Description
Format Disposition Analysis
Usage
format_disposition(
  outdata,
  display_col = c("n", "prop", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)
Arguments
| outdata | A metadata object created by  | 
| display_col | Column wants to display on the table.
The term could be selected from  | 
| digits_prop | Number of digits for proportion columns. | 
| display_stat | A vector of statistics term name.
The term name could be selected from
 | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_disposition(population = "apat", parameter = "disposition;medical-disposition") |>
  format_disposition()
Format Exposure Duration Analysis
Description
Format Exposure Duration Analysis
Usage
format_exp_duration(
  outdata,
  display_col = c("n", "prop", "n_cum", "prop_cum", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)
Arguments
| outdata | A metadata object created by  | 
| display_col | Column wants to display on the table. "n_cum", "prop_cum" can additionally be selected. 
 | 
| digits_prop | Number of digits for proportion columns. | 
| display_stat | A vector of statistics term name.
The term name could be selected from
 | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_exposure_example()
meta |>
  prepare_exp_duration(population = "apat", parameter = "expdur") |>
  format_exp_duration(display_col = c("n", "prop", "total"))
Prepare data for baseline characteristic table
Description
Prepare data for baseline characteristic table
Usage
format_sl_summary(
  outdata,
  display_col = c("n", "prop", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)
Arguments
| outdata | A metadata object created by  | 
| display_col | Column wants to display on the table.
The term could be selected from  | 
| digits_prop | Number of digits for proportion columns. | 
| display_stat | A vector of statistics term name.
The term name could be selected from
 | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_sl_summary(population = "apat", analysis = "base_char", parameter = "age;gender") |>
  format_sl_summary()
Format Treatment Compliance Analysis
Description
Format Treatment Compliance Analysis
Format Treatment Compliance Analysis
Usage
format_trt_compliance(
  outdata,
  display_col = c("n", "prop", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)
format_trt_compliance(
  outdata,
  display_col = c("n", "prop", "total"),
  digits_prop = 1,
  display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range")
)
Arguments
| outdata | A metadata object created by  | 
| display_col | Column wants to display on the table.
The term could be selected from  | 
| digits_prop | Number of digits for proportion columns. | 
| display_stat | A vector of statistics term name.
The term name could be selected from
 | 
Value
A list of analysis raw datasets.
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_trt_compliance(parameter = "comp8;comp16") |>
  format_trt_compliance()
meta <- meta_sl_example()
meta |>
  prepare_trt_compliance(population = "apat", parameter = "comp8;comp16") |>
  format_trt_compliance()
Create metadata for subject-level analysis table
Description
Create metadata for subject-level analysis table
Usage
meta_sl(
  dataset_population,
  dataset_observation = NULL,
  population_term,
  observation_term = NULL,
  parameter_term = "age;race;gender",
  parameter_var = "AGE^AGEGR1;RACE;SEX",
  parameter_labels = NULL,
  analysis_term = "base_char",
  analysis_title = "Participant Baseline Characteristics by Treatment Group",
  population_subset = SAFFL == "Y",
  observation_subset = NULL,
  population_label = "All Participants as Treated",
  treatment_group = "TRT01A"
)
Arguments
| dataset_population | Source dataset of population. | 
| dataset_observation | Source dataset of observation | 
| population_term | A character value of population term name. | 
| observation_term | A character value of observation term name. | 
| parameter_term | A character value of parameter term name. If there are multiple terms, they are separated by the semicolon (;). | 
| parameter_var | A character value of parameter variable name. If there are multiple variables, they are separated by the semicolon (;). A group variable can be specified followed by a variable and the hat symbol (^). | 
| parameter_labels | A character vector of parameter label name.
The length of vector should be the same as the number of parameter terms.
A label from an input data is used if  | 
| analysis_term | A character value of analysis term name. | 
| analysis_title | A character value of analysis title name. | 
| population_subset | An unquoted condition for selecting the populations from dataset of population. | 
| observation_subset | An unquoted condition for selecting the populations from dataset of observation | 
| population_label | A character value of population label. | 
| treatment_group | A character value of treatment group name. | 
Value
A metalite object.
Examples
meta_sl(
  dataset_population = r2rtf::r2rtf_adsl,
  population_term = "apat",
  parameter_term = "age;race",
  parameter_var = "AGE^AGEGR1;RACE"
)
Create an example meta_sl_example object
Description
This function is only for illustration purpose. r2rtf is required.
Usage
meta_sl_example()
Value
A metadata object.
Examples
meta_sl_example()
Create an example meta_sl_exposure_example object
Description
This function is only for illustration purpose. r2rtf is required.
Usage
meta_sl_exposure_example()
Value
A metadata object.
Examples
meta_sl_exposure_example()
Create an interactive plot for exposure duration
Description
Create an interactive plot for exposure duration
Usage
plotly_exp_duration(
  outdata,
  color = NULL,
  display = c("n", "prop"),
  display_total = TRUE,
  plot_type_label =
    c("Comparision of Exposure Duration (> = x days) by Treatment Groups",
    "Comparision of Exposure Duration (> = x days and < y days) by Treatment Groups",
    "Comparision by Exposure Duration (> = x days)"),
  plot_group_label = "Treatment group",
  plot_category_label = "Exposure duration",
  hover_summary_var = c("n", "median", "sd", "se", "median", "min", "max", "q1 to q3",
    "range"),
  width = 1000,
  height = 400
)
Arguments
| outdata | An  | 
| color | Color for a histogram. | 
| display | A character vector of display type.
 | 
| display_total | A logical value to display total. | 
| plot_type_label | A character vector of histogram type. The first element is for the standard histogram. The second element is for the stacked histogram. The third element is for the horizontal histogram. | 
| plot_group_label | A label for grouping. | 
| plot_category_label | A label for category. | 
| hover_summary_var | A character vector of statistics to be displayed on hover label of bar. | 
| width | Width of the plot. | 
| height | Height of the plot. | 
Value
Interactive plot for exposure duration.
Examples
# Only run this example in interactive R sessions
if (interactive()) {
  meta <- meta_sl_exposure_example()
  outdata <- meta |>
    prepare_exp_duration() |>
    extend_exp_duration(
      duration_category_list = list(c(1, NA), c(7, NA), c(28, NA), c(12 * 7, NA), c(24 * 7, NA)),
      duration_category_labels = c(">=1 day", ">=7 days", ">=28 days", ">=12 weeks", ">=24 weeks")
    )
  outdata |> plotly_exp_duration()
}
Prepare data for baseline characteristic table
Description
Prepare data for baseline characteristic table
Usage
prepare_base_char(
  meta,
  analysis = "base_char",
  population = meta$plan[meta$plan$analysis == analysis, ]$population,
  parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse =
    ";")
)
Arguments
| meta | A metadata object created by metalite. | 
| analysis | A character value of analysis term name. The term name is used as key to link information. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |> prepare_base_char()
Prepare data for treatment compliance table
Description
Prepare data for treatment compliance table
Usage
prepare_base_char_subgroup(
  meta,
  population,
  analysis = "base_char_subgroup",
  parameter,
  subgroup_var,
  subgroup_header = c(meta$population[[population]]$group, subgroup_var)
)
Arguments
| meta | A metadata object created by metalite. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| analysis | A character value of analysis term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
| subgroup_var | A character value of subgroup variable name in
observation data saved in  | 
| subgroup_header | A character vector for column header hierarchy. The first element will be the first level header and the second element will be second level header. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
outdata <- prepare_base_char_subgroup(
  meta,
  population = "apat",
  parameter = "age",
  subgroup_var = "TRTA",
  subgroup_header = c("SEX", "TRTA")
)
Prepare data for treatment compliance table
Description
Prepare data for treatment compliance table
Usage
prepare_disposition(
  meta,
  analysis = "disp",
  population = meta$plan[meta$plan$analysis == analysis, ]$population,
  parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse =
    ";")
)
Arguments
| meta | A metadata object created by metalite. | 
| analysis | A character value of analysis term name. The term name is used as key to link information. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |> prepare_base_char()
Prepare data for exposure duration table
Description
Prepare data for exposure duration table
Usage
prepare_exp_duration(
  meta,
  analysis = "exp_dur",
  population = meta$plan[meta$plan$analysis == analysis, ]$population,
  parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse =
    ";")
)
Arguments
| meta | A metadata object created by metalite. | 
| analysis | A character value of analysis term name. The term name is used as key to link information. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_exposure_example()
meta |> prepare_exp_duration()
Prepare data for baseline characteristic table
Description
Prepare data for baseline characteristic table
Usage
prepare_sl_summary(
  meta,
  population,
  analysis,
  parameter = paste(names(meta$parameter), collapse = ";")
)
Arguments
| meta | A metadata object created by metalite. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| analysis | A character value of analysis term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |> prepare_sl_summary(population = "apat", analysis = "base_char")
Prepare data for treatment compliance table
Description
Prepare data for treatment compliance table
Usage
prepare_trt_compliance(
  meta,
  analysis = "trt_compliance",
  population = meta$plan[meta$plan$analysis == analysis, ]$population,
  parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse =
    ";")
)
Arguments
| meta | A metadata object created by metalite. | 
| analysis | A character value of analysis term name. The term name is used as key to link information. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| parameter | A character value of parameter term name. The term name is used as key to link information. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |> prepare_trt_compliance()
Display interactive baseline characteristic tables with AE subgroup analysis
Description
Display interactive baseline characteristic tables with AE subgroup analysis
Usage
react_base_char(
  metadata_sl,
  metadata_ae,
  population = "apat",
  observation = "wk12",
  display_total = TRUE,
  sl_parameter = "age;gender;race",
  ae_subgroup = c("gender", "race"),
  ae_specific = "rel",
  width = 1200
)
Arguments
| metadata_sl | A metadata created by metalite, which builds the baseline characteristic table | 
| metadata_ae | A metadata created by metalite, which builds the AE subgroup specific table | 
| population | A character value of population term name. The term name is used as key to link information. | 
| observation | A character value of observation term name. The term name is used as key to link information. | 
| display_total | Display total column or not. | 
| sl_parameter | A character value of parameter term name for the baseline characteristic table. The term name is used as key to link information. | 
| ae_subgroup | A vector of strubf to specify the subgroups in the AE subgroup specific table. | 
| ae_specific | A string specifying the AE specific category. | 
| width | A numeric value of width of the table in pixels. | 
Value
An reactable combing both baseline characteristic table and AE subgroup specific tables.
Examples
if (interactive()) {
  react_base_char(
    metadata_sl = meta_sl_example(),
    metadata_ae = metalite.ae::meta_ae_example(),
    population = "apat",
    observation = "wk12",
    display_total = TRUE,
    sl_parameter = "age;gender;race",
    ae_subgroup = c("age", "race", "gender"),
    ae_specific = "rel",
    width = 1200
  )
}
Display interactive disposition tables with AE subgroup analysis
Description
Display interactive disposition tables with AE subgroup analysis
Usage
react_disposition(
  metadata_sl,
  metadata_ae,
  analysis = "disp",
  trtvar = metalite::collect_adam_mapping(metadata_sl, population)$group,
  population = metadata_sl$plan$population[metadata_sl$plan$analysis == analysis],
  sl_parameter = paste(metadata_sl$plan$parameter[metadata_sl$plan$analysis == analysis],
    collapse = ";"),
  sl_col_selected = c("siteid", "subjid", "sex", "age", "weightbl"),
  sl_col_names = c("Site", "Subject ID", "Sex", "Age (Year)", "Weight (kg)"),
  ae_observation = "wk12",
  ae_population = population,
  ae_col_selected = c("AESOC", "ASTDT", "AENDT", "AETERM", "duration", "AESEV", "AESER",
    "related", "AEACN", "AEOUT"),
  ae_col_names = c("SOC", "Onset Date", "End Date", "AE", "Duraion", "Intensity",
    "Serious", "Related", "Action Taken", "Outcome"),
  display_total = TRUE,
  width = 1200
)
Arguments
| metadata_sl | A metadata created by metalite, which builds the baseline characteristic table | 
| metadata_ae | A metadata created by metalite, which builds the AE subgroup specific table | 
| analysis | The analysis label provided in  | 
| trtvar | A character that indicate variable for the treatment group. | 
| population | A character value of population term name. The term name is used as key to link information. | 
| sl_parameter | A character value of parameter term name for the baseline characteristic table. The term name is used as key to link information. | 
| sl_col_selected | A character vector of variable which will be shown in the participant detail. | 
| sl_col_names | A character vector for the columns names of the participant detail. Same length as sl_col_selected. | 
| ae_observation | The meta parameter of the observation in adverse event listing. | 
| ae_population | The meta parameter of the population in adverse event listing. | 
| ae_col_selected | A character vector of variable which will be shown in the AE detail. | 
| ae_col_names | A character vector for the columns names of the AE detail. Same length as ae_col_selected. | 
| display_total | Display total column or not. | 
| width | A numeric value of width of the table in pixels. | 
Value
An reactable combing both baseline characteristic table and AE subgroup specific tables.
Examples
if (interactive()) {
  react_disposition(
    metadata_sl = meta_sl_example(),
    metadata_ae = metalite.ae::meta_ae_example()
  )
}
Baseline characteristic table
Description
Baseline characteristic table
Usage
rtf_base_char(
  outdata,
  source,
  col_rel_width = NULL,
  text_font_size = 9,
  orientation = "portrait",
  footnotes = NULL,
  title = NULL,
  path_outdata = NULL,
  path_outtable = NULL
)
Arguments
| outdata | An  | 
| source | A character value of the data source. | 
| col_rel_width | Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. | 
| text_font_size | Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). | 
| orientation | Orientation in 'portrait' or 'landscape'. | 
| footnotes | A character vector of table footnotes. | 
| title | Term "analysis", "observation" and "population") for collecting title from metadata or a character vector of table titles. | 
| path_outdata | A character string of the outdata path. | 
| path_outtable | A character string of the outtable path. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_base_char(
    population = "apat",
    analysis = "base_char",
    parameter = "age;gender"
  ) |>
  format_base_char() |>
  rtf_base_char(
    source = "Source: [CDISCpilot: adam-adsl]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )
Subgroup Analysis for Baseline Characteristic
Description
Subgroup Analysis for Baseline Characteristic
Usage
rtf_base_char_subgroup(
  outdata,
  source,
  col_rel_width = NULL,
  text_font_size = 8,
  orientation = "landscape",
  footnotes = NULL,
  title = NULL,
  path_outdata = NULL,
  path_outtable = NULL
)
Arguments
| outdata | An  | 
| source | A character value of the data source. | 
| col_rel_width | Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. | 
| text_font_size | Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). | 
| orientation | Orientation in 'portrait' or 'landscape'. | 
| footnotes | A character vector of table footnotes. | 
| title | Term "analysis", "observation" and "population") for collecting title from metadata or a character vector of table titles. | 
| path_outdata | A character string of the outdata path. | 
| path_outtable | A character string of the outtable path. | 
Value
RTF file and source dataset for baseline characteristic table.
Examples
meta <- meta_sl_example()
outdata <- prepare_base_char_subgroup(
  meta,
  population = "apat",
  parameter = "age",
  subgroup_var = "TRTA",
  subgroup_header = c("SEX", "TRTA")
)
outdata |>
  format_base_char_subgroup() |>
  rtf_base_char_subgroup(
    source = "Source:  [CDISCpilot: adam-adsl]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )
Disposition table
Description
Disposition table
Usage
rtf_disposition(
  outdata,
  source,
  col_rel_width = NULL,
  text_font_size = 9,
  orientation = "portrait",
  footnotes = NULL,
  title = NULL,
  path_outdata = NULL,
  path_outtable = NULL
)
Arguments
| outdata | An  | 
| source | A character value of the data source. | 
| col_rel_width | Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. | 
| text_font_size | Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). | 
| orientation | Orientation in 'portrait' or 'landscape'. | 
| footnotes | A character vector of table footnotes. | 
| title | Term "analysis", "observation" and "population") for collecting title from metadata or a character vector of table titles. | 
| path_outdata | A character string of the outdata path. | 
| path_outtable | A character string of the outtable path. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_disposition(population = "apat", parameter = "disposition;medical-disposition") |>
  format_disposition() |>
  rtf_disposition(
    source = "Source: [CDISCpilot: adam-adsl]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )
Exposure duration table
Description
Exposure duration table
Usage
rtf_exp_duration(
  outdata,
  source = "Source: [CDISCpilot: adam-adsl; adex]",
  col_rel_width = NULL,
  text_font_size = 9,
  orientation = "portrait",
  footnotes =
    c("Each participant is counted once on each applicable duration category row.",
    "Duration of Exposure is the time from the first dose date to the last dose date."),
  title = NULL,
  path_outdata = NULL,
  path_outtable = NULL
)
Arguments
| outdata | An  | 
| source | A character value of the data source. | 
| col_rel_width | Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. | 
| text_font_size | Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). | 
| orientation | Orientation in 'portrait' or 'landscape'. | 
| footnotes | A character vector of table footnotes. | 
| title | Term "analysis", "observation" and "population") for collecting title from metadata or a character vector of table titles. | 
| path_outdata | A character string of the outdata path. | 
| path_outtable | A character string of the outtable path. | 
Value
RTF file and source dataset for baseline characteristic table.
Examples
meta <- meta_sl_exposure_example()
meta |>
  prepare_exp_duration(population = "apat", parameter = "expdur") |>
  format_exp_duration(display_col = c("n", "prop", "total")) |>
  rtf_exp_duration(
    source = "Source: [CDISCpilot: adam-adsl; adex]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )
Baseline characteristic table
Description
Baseline characteristic table
Usage
rtf_sl_summary(
  outdata,
  source,
  col_rel_width = NULL,
  text_font_size = 9,
  orientation = "portrait",
  footnotes = NULL,
  title = NULL,
  path_outdata = NULL,
  path_outtable = NULL
)
Arguments
| outdata | An  | 
| source | A character value of the data source. | 
| col_rel_width | Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. | 
| text_font_size | Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). | 
| orientation | Orientation in 'portrait' or 'landscape'. | 
| footnotes | A character vector of table footnotes. | 
| title | Term "analysis", "observation" and "population") for collecting title from metadata or a character vector of table titles. | 
| path_outdata | A character string of the outdata path. | 
| path_outtable | A character string of the outtable path. | 
Value
RTF file and source dataset for baseline characteristic table.
Examples
meta <- meta_sl_example()
meta |>
  prepare_sl_summary(
    population = "apat",
    analysis = "base_char",
    parameter = "age;gender"
  ) |>
  format_sl_summary() |>
  rtf_sl_summary(
    source = "Source: [CDISCpilot: adam-adsl]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )
Treatment compliance table
Description
Treatment compliance table
Usage
rtf_trt_compliance(
  outdata,
  source,
  col_rel_width = NULL,
  text_font_size = 9,
  orientation = "portrait",
  footnotes = NULL,
  title = NULL,
  path_outdata = NULL,
  path_outtable = NULL
)
Arguments
| outdata | An  | 
| source | A character value of the data source. | 
| col_rel_width | Column relative width in a vector e.g. c(2,1,1) refers to 2:1:1. Default is NULL for equal column width. | 
| text_font_size | Text font size. To vary text font size by column, use numeric vector with length of vector equal to number of columns displayed e.g. c(9,20,40). | 
| orientation | Orientation in 'portrait' or 'landscape'. | 
| footnotes | A character vector of table footnotes. | 
| title | Term "analysis", "observation" and "population") for collecting title from metadata or a character vector of table titles. | 
| path_outdata | A character string of the outdata path. | 
| path_outtable | A character string of the outtable path. | 
Value
A list of analysis raw datasets.
Examples
meta <- meta_sl_example()
meta |>
  prepare_trt_compliance(population = "apat", parameter = "comp8;comp16") |>
  format_trt_compliance() |>
  rtf_trt_compliance(
    source = "Source: [CDISCpilot: adam-adsl]",
    path_outdata = tempfile(fileext = ".Rdata"),
    path_outtable = tempfile(fileext = ".rtf")
  )