Title: | Subject-Level Analysis Using 'metalite' |
---|---|
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/>. |
Authors: | 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 <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2024-12-24 09:32:26 UTC |
Source: | https://github.com/cran/metalite.sl |
Count number of subjects
collect_baseline( meta, population, parameter, type = "Subjects", use_na = c("ifany", "no", "always"), display_total = TRUE )
collect_baseline( meta, population, parameter, type = "Subjects", use_na = c("ifany", "no", "always"), display_total = TRUE )
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. |
A list containing number of subjects
meta <- meta_sl_example() meta |> collect_baseline( population = "apat", parameter = "age" )
meta <- meta_sl_example() meta |> collect_baseline( population = "apat", parameter = "age" )
Deformat percent
defmt_pct(pct)
defmt_pct(pct)
pct |
string eager to remove percent |
Numeric value without percent
defmt_pct("10.0%") defmt_pct(c("10.0%", "(11.2%)"))
defmt_pct("10.0%") defmt_pct(c("10.0%", "(11.2%)"))
Add cumulative count and summary stats for categories for exposure duration analysis
extend_exp_duration( outdata, category_section_label = NULL, duration_category_list = NULL, duration_category_labels = NULL )
extend_exp_duration( outdata, category_section_label = NULL, duration_category_list = NULL, duration_category_labels = NULL )
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. |
A list of analysis raw datasets.
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(21, NA)), duration_category_labels = c(">=1 day", ">=7 days", ">=21 days") )
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(21, NA)), duration_category_labels = c(">=1 day", ">=7 days", ">=21 days") )
Format Baseline Characteristics Analysis
format_base_char( outdata, display_col = c("n", "prop", "total"), digits_prop = 1, display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range") )
format_base_char( outdata, display_col = c("n", "prop", "total"), digits_prop = 1, display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range") )
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
|
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_base_char(population = "apat", parameter = "age;gender") |> format_base_char()
meta <- meta_sl_example() meta |> prepare_base_char(population = "apat", parameter = "age;gender") |> format_base_char()
Prepare data for Subgroup Analysis for Baseline Characteristic
format_base_char_subgroup( outdata, display = c("n", "prop", "total"), display_stat = c("mean", "sd", "median", "range") )
format_base_char_subgroup( outdata, display = c("n", "prop", "total"), display_stat = c("mean", "sd", "median", "range") )
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
|
A list of analysis raw datasets.
meta <- meta_sl_example() outdata <- prepare_base_char_subgroup( meta, population = "apat", parameter = "age", subgroup_var = "TRTA", subgroup_header = c("SEX", "TRTA"), display_subgroup_total = TRUE ) outdata |> format_base_char_subgroup()
meta <- meta_sl_example() outdata <- prepare_base_char_subgroup( meta, population = "apat", parameter = "age", subgroup_var = "TRTA", subgroup_header = c("SEX", "TRTA"), display_subgroup_total = TRUE ) outdata |> format_base_char_subgroup()
Format Disposition Analysis
format_disposition( outdata, display_col = c("n", "prop", "total"), digits_prop = 1, display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range") )
format_disposition( outdata, display_col = c("n", "prop", "total"), digits_prop = 1, display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range") )
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
|
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_disposition(population = "apat", parameter = "disposition;medical-disposition") |> format_disposition()
meta <- meta_sl_example() meta |> prepare_disposition(population = "apat", parameter = "disposition;medical-disposition") |> format_disposition()
Format Exposure Duration Analysis
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") )
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") )
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
|
A list of analysis raw datasets.
meta <- meta_sl_exposure_example() meta |> prepare_exp_duration(population = "apat", parameter = "expdur") |> format_exp_duration(display_col = c("n", "prop", "total"))
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
format_sl_summary( outdata, display_col = c("n", "prop", "total"), digits_prop = 1, display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range") )
format_sl_summary( outdata, display_col = c("n", "prop", "total"), digits_prop = 1, display_stat = c("mean", "sd", "se", "median", "q1 to q3", "range") )
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
|
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_sl_summary(population = "apat", analysis = "base_char", parameter = "age;gender") |> format_sl_summary()
meta <- meta_sl_example() meta |> prepare_sl_summary(population = "apat", analysis = "base_char", parameter = "age;gender") |> format_sl_summary()
Format Treatment Compliance Analysis
Format Treatment Compliance Analysis
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") )
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") )
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
|
A list of analysis raw datasets.
A list of analysis raw datasets.
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()
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
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" )
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" )
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. |
A metalite object.
meta_sl( dataset_population = r2rtf::r2rtf_adsl, population_term = "apat", parameter_term = "age;race", parameter_var = "AGE^AGEGR1;RACE" )
meta_sl( dataset_population = r2rtf::r2rtf_adsl, population_term = "apat", parameter_term = "age;race", parameter_var = "AGE^AGEGR1;RACE" )
meta_sl_example
objectThis function is only for illustration purpose. r2rtf is required.
meta_sl_example()
meta_sl_example()
A metadata object.
meta_sl_example()
meta_sl_example()
meta_sl_exposure_example
objectThis function is only for illustration purpose. r2rtf is required.
meta_sl_exposure_example()
meta_sl_exposure_example()
A metadata object.
meta_sl_exposure_example()
meta_sl_exposure_example()
Create an interactive plot for exposure duration
plotly_exp_duration( outdata, color = NULL, display = c("n", "prop"), display_total = TRUE, 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 )
plotly_exp_duration( outdata, color = NULL, display = c("n", "prop"), display_total = TRUE, 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 )
outdata |
An |
color |
Color for a histogram. |
display |
A character vector of display type.
|
display_total |
A logical value to display total. |
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. |
Interactive plot for exposure duration.
# 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, 7), c(7, 21), c(21, 84)), duration_category_labels = c("1-7 days", "7-21 days", "21-84 days") ) outdata |> plotly_exposure_duration() }
# 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, 7), c(7, 21), c(21, 84)), duration_category_labels = c("1-7 days", "7-21 days", "21-84 days") ) outdata |> plotly_exposure_duration() }
Prepare data for baseline characteristic table
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 = ";") )
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 = ";") )
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. |
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_base_char()
meta <- meta_sl_example() meta |> prepare_base_char()
Prepare data for treatment compliance table
prepare_base_char_subgroup( meta, population, analysis = "base_char_subgroup", parameter, subgroup_var, subgroup_header = c(meta$population[[population]]$group, subgroup_var), display_subgroup_total = TRUE )
prepare_base_char_subgroup( meta, population, analysis = "base_char_subgroup", parameter, subgroup_var, subgroup_header = c(meta$population[[population]]$group, subgroup_var), display_subgroup_total = TRUE )
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. |
display_subgroup_total |
A logic value of displaying the total group. |
A list of analysis raw datasets.
meta <- meta_sl_example() outdata <- prepare_base_char_subgroup( meta, population = "apat", parameter = "age", subgroup_var = "TRTA", subgroup_header = c("SEX", "TRTA"), display_subgroup_total = TRUE )
meta <- meta_sl_example() outdata <- prepare_base_char_subgroup( meta, population = "apat", parameter = "age", subgroup_var = "TRTA", subgroup_header = c("SEX", "TRTA"), display_subgroup_total = TRUE )
Prepare data for treatment compliance table
prepare_disposition( meta, analysis = "disp", population = meta$plan[meta$plan$analysis == analysis, ]$population, parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse = ";") )
prepare_disposition( meta, analysis = "disp", population = meta$plan[meta$plan$analysis == analysis, ]$population, parameter = paste(meta$plan[meta$plan$analysis == analysis, ]$parameter, collapse = ";") )
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. |
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_base_char()
meta <- meta_sl_example() meta |> prepare_base_char()
Prepare data for exposure duration table
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 = ";") )
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 = ";") )
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. |
A list of analysis raw datasets.
meta <- meta_sl_exposure_example() meta |> prepare_exp_duration()
meta <- meta_sl_exposure_example() meta |> prepare_exp_duration()
Prepare data for baseline characteristic table
prepare_sl_summary( meta, population, analysis, parameter = paste(names(meta$parameter), collapse = ";") )
prepare_sl_summary( meta, population, analysis, parameter = paste(names(meta$parameter), collapse = ";") )
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. |
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_sl_summary(population = "apat", analysis = "base_char")
meta <- meta_sl_example() meta |> prepare_sl_summary(population = "apat", analysis = "base_char")
Prepare data for treatment compliance table
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 = ";") )
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 = ";") )
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. |
A list of analysis raw datasets.
meta <- meta_sl_example() meta |> prepare_trt_compliance()
meta <- meta_sl_example() meta |> prepare_trt_compliance()
Display interactive baseline characteristic tables with AE subgroup analysis
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 )
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 )
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. |
An reactable combing both baseline characteristic table and AE subgroup specific tables.
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 ) }
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
react_disposition( metadata_sl, metadata_ae, analysis = "disp", population = metadata_sl$plan[metadata_sl$plan$analysis == analysis, ]$population, sl_parameter = paste(metadata_sl$plan[metadata_sl$plan$analysis == analysis, ]$parameter, collapse = ";"), display_total = TRUE, width = 1200 )
react_disposition( metadata_sl, metadata_ae, analysis = "disp", population = metadata_sl$plan[metadata_sl$plan$analysis == analysis, ]$population, sl_parameter = paste(metadata_sl$plan[metadata_sl$plan$analysis == analysis, ]$parameter, collapse = ";"), display_total = TRUE, width = 1200 )
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 |
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. |
display_total |
Display total column or not. |
width |
A numeric value of width of the table in pixels. |
An reactable combing both baseline characteristic table and AE subgroup specific tables.
if (interactive()) { react_disposition( metadata_sl = meta_sl_example(), metadata_ae = metalite.ae::meta_ae_example(), width = 1200 ) }
if (interactive()) { react_disposition( metadata_sl = meta_sl_example(), metadata_ae = metalite.ae::meta_ae_example(), width = 1200 ) }
Baseline characteristic table
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 )
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 )
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. |
A list of analysis raw datasets.
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") )
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
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 )
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 )
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. |
RTF file and source dataset for baseline characteristic table.
meta <- meta_sl_example() outdata <- prepare_base_char_subgroup( meta, population = "apat", parameter = "age", subgroup_var = "TRTA", subgroup_header = c("SEX", "TRTA"), display_subgroup_total = TRUE ) outdata |> format_base_char_subgroup() |> rtf_base_char_subgroup( source = "Source: [CDISCpilot: adam-adsl]", path_outdata = tempfile(fileext = ".Rdata"), path_outtable = tempfile(fileext = ".rtf") )
meta <- meta_sl_example() outdata <- prepare_base_char_subgroup( meta, population = "apat", parameter = "age", subgroup_var = "TRTA", subgroup_header = c("SEX", "TRTA"), display_subgroup_total = TRUE ) 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
rtf_disposition( outdata, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", footnotes = NULL, title = NULL, path_outdata = NULL, path_outtable = NULL )
rtf_disposition( outdata, source, col_rel_width = NULL, text_font_size = 9, orientation = "portrait", footnotes = NULL, title = NULL, path_outdata = NULL, path_outtable = NULL )
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. |
A list of analysis raw datasets.
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") )
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
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 )
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 )
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. |
RTF file and source dataset for baseline characteristic table.
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") )
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
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 )
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 )
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. |
RTF file and source dataset for baseline characteristic table.
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") )
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
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 )
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 )
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. |
A list of analysis raw datasets.
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") )
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") )