Type: | Package |
Title: | Standard TLGs for Clinical Trials Reporting |
Version: | 0.2.12 |
Date: | 2025-06-18 |
Description: | Provide standard tables, listings, and graphs (TLGs) libraries used in clinical trials. This package implements a structure to reformat the data with 'dunlin', create reporting tables using 'rtables' and 'tern' with standardized input arguments to enable quick generation of standard outputs. In addition, it also provides comprehensive data checks and script generation functionality. |
License: | Apache License 2.0 |
URL: | https://insightsengineering.github.io/chevron/, https://github.com/insightsengineering/chevron/ |
BugReports: | https://github.com/insightsengineering/chevron/issues |
Depends: | R (≥ 4.1.0) |
Imports: | checkmate (≥ 2.1.0), dplyr (≥ 1.1.0), dunlin (≥ 0.1.10), forcats (≥ 1.0.0), formatters (≥ 0.5.11), ggplot2 (≥ 3.4.0), glue (≥ 1.0.0), grid, lifecycle (≥ 0.2.0), lubridate (≥ 1.7.8), magrittr (≥ 1.5), methods, nestcolor (≥ 0.1.1), purrr (≥ 0.3.0), rlang (≥ 1.0.0), rlistings (≥ 0.2.12), rtables (≥ 0.6.13), stringr (≥ 1.4.1), tern (≥ 0.9.9), tibble (≥ 2.0.0), utils |
Suggests: | knitr (≥ 1.42), rmarkdown (≥ 2.23), testthat (≥ 3.0.4), tidyr (≥ 0.8.3), vdiffr (≥ 1.0.7), withr (≥ 2.1.0) |
VignetteBuilder: | knitr, rmarkdown |
Config/Needs/verdepcheck: | mllg/checkmate, tidyverse/dplyr, insightsengineering/dunlin, tidyverse/forcats, insightsengineering/formatters, tidyverse/ggplot2, tidyverse/glue, r-lib/lifecycle, tidyverse/lubridate, tidyverse/magrittr, insightsengineering/nestcolor, tidyverse/purrr, r-lib/rlang, insightsengineering/rlistings, insightsengineering/rtables, tidyverse/stringr, insightsengineering/tern, tidyverse/tibble, yihui/knitr, rstudio/rmarkdown, r-lib/testthat, tidyverse/tidyr, r-lib/vdiffr, r-lib/withr |
Config/Needs/website: | insightsengineering/nesttemplate |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
Language: | en-US |
LazyData: | true |
RoxygenNote: | 7.3.2 |
Collate: | 'report_null.R' 'utils.R' 'chevron_tlg-S4class.R' 'ael01_nollt.R' 'ael02.R' 'ael03.R' 'aet01.R' 'aet01_aesi.R' 'aet02.R' 'aet03.R' 'aet04.R' 'aet05.R' 'aet05_all.R' 'aet10.R' 'assertions.R' 'cfbt01.R' 'checks.R' 'chevron_tlg-S4methods.R' 'cml02a_gl.R' 'cmt01a.R' 'cmt02_pt.R' 'coxt01.R' 'coxt02.R' 'data.R' 'dmt01.R' 'dst01.R' 'dtht01.R' 'dummy_template.R' 'egt01.R' 'egt02.R' 'egt03.R' 'egt05_qtcat.R' 'ext01.R' 'fstg01.R' 'fstg02.R' 'gen_args.R' 'kmg01.R' 'lbt01.R' 'lbt04.R' 'lbt05.R' 'lbt06.R' 'lbt07.R' 'lbt14.R' 'lbt15.R' 'mht01.R' 'mng01.R' 'package.R' 'pdt01.R' 'pdt02.R' 'reexports.R' 'rmpt01.R' 'rmpt03.R' 'rmpt04.R' 'rmpt05.R' 'rmpt06.R' 'rspt01.R' 'rtables_utils.R' 'standard_rules.R' 'ttet01.R' 'unwrap.R' 'vst01.R' 'vst02.R' 'zzz.R' |
NeedsCompilation: | no |
Packaged: | 2025-06-20 13:18:36 UTC; falquetb |
Author: | Liming Li |
Maintainer: | Joe Zhu <joe.zhu@roche.com> |
Repository: | CRAN |
Date/Publication: | 2025-06-20 14:10:02 UTC |
chevron
package
Description
Provide standard tables, listings, and graphs (TLGs) libraries used in clinical trials. This package implements a structure to reformat the data with 'dunlin', create reporting tables using 'rtables' and 'tern' with standardized input arguments to enable quick generation of standard outputs. In addition, it also provides comprehensive data checks and script generation functionality.
Author(s)
Maintainer: Joe Zhu joe.zhu@roche.com (ORCID)
Authors:
Liming Li liming.li@roche.com (ORCID) (Original creator of the package)
Benoit Falquet benoit.falquet@roche.com (ORCID) (Original creator of the package)
Xiaoli Duan xiaoli.duan@roche.com
Other contributors:
Adrian Waddell waddell.adrian@gene.com [contributor]
Chenkai Lv chenkai.lv@roche.com [contributor]
Pawel Rucki pawel.rucki@roche.com [contributor]
Tim Barnett timothy.barnett@roche.com [contributor]
Tian Fang tian.fang@roche.com [contributor]
F. Hoffmann-La Roche AG [copyright holder, funder]
See Also
Useful links:
Report bugs at https://github.com/insightsengineering/chevron/issues
AEL01_NOLLT
Listing 1 (Default) Glossary of Preferred Terms and Investigator-Specified Terms.
Description
AEL01_NOLLT
Listing 1 (Default) Glossary of Preferred Terms and Investigator-Specified Terms.
Usage
ael01_nollt_main(
adam_db,
dataset = "adae",
key_cols = c("AEBODSYS", "AEDECOD"),
disp_cols = "AETERM",
split_into_pages_by_var = NULL,
unique_rows = TRUE,
...
)
ael01_nollt_pre(
adam_db,
dataset = "adae",
key_cols = c("AEBODSYS", "AEDECOD"),
disp_cols = "AETERM",
...
)
ael01_nollt
Arguments
adam_db |
( |
dataset |
( |
key_cols |
( |
disp_cols |
( |
split_into_pages_by_var |
( |
unique_rows |
( |
... |
additional arguments passed to |
Format
An object of class chevron_l
of length 1.
Details
Removes duplicate rows.
By default, uses dataset
adae
, sorting by key columnsAEBODSYS
andAEDECOD
.If using with a dataset other than
adae
, be sure to specify the desired labels for variables inkey_cols
anddisp_cols
, and pre-process missing data.
Value
the main function returns an rlistings
or a list
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
ael01_nollt_main()
: Main TLG function -
ael01_nollt_pre()
: Preprocessing
Note
-
adam_db
object must contain thedataset
table with columns specified bykey_cols
anddisp_cols
.
Examples
run(ael01_nollt, syn_data)
AEL02
Listing 1 (Default) Listing of Adverse Events.
Description
AEL02
Listing 1 (Default) Listing of Adverse Events.
Usage
ael02_main(
adam_db,
dataset = "adae",
key_cols = c("ID", "ASR"),
disp_cols = c("AEDECOD", "TRTSDTM", "ASTDY", "ADURN", "AESER", "ASEV", "AREL", "AEOUT",
"AECONTRT", "AEACN"),
split_into_pages_by_var = "ACTARM",
unique_rows = FALSE,
...
)
ael02_pre(adam_db, dataset = "adae", arm_var = "ACTARM", ...)
ael02
Arguments
adam_db |
( |
dataset |
( |
key_cols |
( |
disp_cols |
( |
split_into_pages_by_var |
( |
unique_rows |
( |
... |
not used. |
arm_var |
( |
Format
An object of class chevron_l
of length 1.
Value
the main function returns an rlistings
or a list
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
ael02_main()
: Main TLG function -
ael02_pre()
: Preprocessing
Examples
res <- run(ael02, syn_data)
AEL03
Listing 1 (Default) Listing of Serious Adverse Events.
Description
AEL03
Listing 1 (Default) Listing of Serious Adverse Events.
Usage
ael03_main(
adam_db,
dataset = "adae",
key_cols = c("ID", "ASR"),
disp_cols = c("AEDECOD", "TRTSDTM", "ASTDY", "ADURN", "ASEV", "AREL", "AEOUT",
"AECONTRT", "AEACN", "SERREAS"),
split_into_pages_by_var = "ACTARM",
unique_rows = FALSE,
...
)
ael03_pre(adam_db, dataset = "adae", arm_var = "ACTARM", ...)
ael03
Arguments
adam_db |
( |
dataset |
( |
key_cols |
( |
disp_cols |
( |
split_into_pages_by_var |
( |
unique_rows |
( |
... |
not used. |
arm_var |
( |
Format
An object of class chevron_l
of length 1.
Value
the main function returns an rlistings
or a list
object.
Functions
-
ael03_main()
: Main TLG function -
ael03_pre()
: Preprocessing
Examples
res <- run(ael03, syn_data)
aet01_aesi
Layout
Description
aet01_aesi
Layout
Usage
aet01_aesi_lyt(arm_var, aesi_vars, lbl_overall, lbl_aesi_vars, grade_groups)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_aesi_vars |
( |
Value
a PreDataTableLayouts
object.
AET01_AESI
Table 1 (Default) Adverse Event of Special Interest Summary Table.
Description
AET01_AESI
Table 1 (Default) Adverse Event of Special Interest Summary Table.
Usage
aet01_aesi_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
aesi_vars = NULL,
grade_groups = NULL,
...
)
aet01_aesi_pre(adam_db, ...)
aet01_aesi_post(tlg, prune_0 = FALSE, ...)
aet01_aesi
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
aesi_vars |
( |
grade_groups |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Does not remove rows with zero counts by default.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet01_aesi_main()
: Main TLG function -
aet01_aesi_pre()
: Preprocessing -
aet01_aesi_post()
: Postprocessing
Note
-
adam_db
object must contain anadae
table with columns"AEOUT"
,"AEACN"
,"AECONTRT"
,"AESER"
,"AREL"
, and the column specified byarm_var
. -
aesi_vars
may contain any/all of the following variables to display:"ALLRESWD"
,"ALLRESDSM"
,"ALLRESCONTRT"
,"NOTRESWD"
,"NOTRESDSM"
,"NOTRESCONTRT"
,"SERWD"
,"SERDSM"
,"SERCONTRT"
,"RELWD"
,"RELDSM"
,"RELCONTRT"
,"RELSER"
. -
aesi_vars
variable prefixes are defined as follows:-
"ALLRES"
= "all non-fatal adverse events resolved" -
"NOTRES"
= "at least one unresolved or ongoing non-fatal adverse event" -
"SER"
= "serious adverse event" -
"REL"
= "related adverse event"
-
-
aesi_vars
variable suffixes are defined as follows:-
"WD"
= "patients with study drug withdrawn" -
"DSM"
= "patients with dose modified/interrupted" -
"CONTRT"
= "patients with treatment received"
-
Several
aesi_vars
can be added to the table at once:-
aesi_vars = "ALL"
will include all possibleaesi_vars
. Including
"ALL_XXX"
inaesi_vars
whereXXX
is one of the prefixes listed above will include allaesi_vars
with that prefix.
-
Examples
run(aet01_aesi, syn_data)
aet01
Layout
Description
aet01
Layout
Usage
aet01_lyt(arm_var, lbl_overall, anl_vars, anl_lbls, lbl_vars)
Arguments
arm_var |
( |
lbl_overall |
( |
anl_vars |
Named ( |
anl_lbls |
( |
lbl_vars |
Named ( |
Value
a PreDataTableLayouts
object.
AET01
Table 1 (Default) Overview of Deaths and Adverse Events Summary Table 1.
Description
AET01
Table 1 (Default) Overview of Deaths and Adverse Events Summary Table 1.
Usage
aet01_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
anl_vars = list(safety_var = c("FATAL", "SER", "SERWD", "SERDSM", "RELSER", "WD",
"DSM", "REL", "RELWD", "RELDSM", "SEV")),
anl_lbls = "Total number of {patient_label} with at least one",
show_wd = TRUE,
...
)
aet01_pre(adam_db, ...)
aet01_post(tlg, prune_0 = FALSE, ...)
aet01
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
anl_vars |
Named ( |
anl_lbls |
( |
show_wd |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Does not remove rows with zero counts by default.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet01_main()
: Main TLG function -
aet01_pre()
: Preprocessing -
aet01_post()
: Postprocessing
Note
-
adam_db
object must contain anadsl
table with the"DTHFL"
and"DCSREAS"
columns. -
adam_db
object must contain anadae
table with the columns passed toanl_vars
.
Examples
run(aet01, syn_data, arm_var = "ARM")
AET02
Table 1 (Default) Adverse Events by System Organ Class and Preferred Term Table 1.
Description
The AET02
table provides an overview of the number of subjects experiencing adverse events and the number of advert
events categorized by Body System and Dictionary-Derived Term.
Usage
aet02_label
aet02_main(
adam_db,
arm_var = "ACTARM",
row_split_var = "AEBODSYS",
lbl_overall = NULL,
summary_labels = list(all = aet02_label, TOTAL = c(nonunique =
"Overall total number of events")),
...
)
aet02_pre(adam_db, row_split_var = "AEBODSYS", ...)
aet02_post(tlg, row_split_var = "AEBODSYS", prune_0 = TRUE, ...)
aet02
Arguments
adam_db |
( |
arm_var |
( |
row_split_var |
( |
lbl_overall |
( |
summary_labels |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class character
of length 2.
An object of class chevron_t
of length 1.
Details
Numbers represent absolute numbers of subject and fraction of
N
, or absolute number of event when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort Dictionary-Derived Code (
AEDECOD
) by highest overall frequencies.Missing values in
AEBODSYS
, andAEDECOD
are labeled byNo Coding Available
.summary_labels
is used to control the summary for each level. If "all" is used, then each split will have that summary statistic with the labels. One special case is "TOTAL", this is for the overall population.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet02_label
: Default labels -
aet02_main()
: Main TLG function -
aet02_pre()
: Preprocessing -
aet02_post()
: Postprocessing
Note
-
adam_db
object must contain anadae
table with the columns"AEBODSYS"
and"AEDECOD"
.
Examples
run(aet02, syn_data)
aet03
Layout
Description
aet03
Layout
Usage
aet03_lyt(arm_var, lbl_overall, lbl_aebodsys, lbl_aedecod, intensity_grade)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_aebodsys |
( |
lbl_aedecod |
( |
intensity_grade |
( |
Value
a PreDataTableLayouts
object.
AET03
Table 1 (Default) Advert Events by Greatest Intensity Table 1.
Description
An adverse events table categorized by System Organ Class, Dictionary-Derived Term and Greatest intensity.
Usage
aet03_main(adam_db, arm_var = "ACTARM", lbl_overall = NULL, ...)
aet03_pre(adam_db, ...)
aet03_post(tlg, prune_0 = TRUE, ...)
aet03
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Default Adverse Events by Greatest Intensity table.
Numbers represent absolute numbers of patients and fraction of
N
.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort by Body System or Organ Class (
SOC
) and Dictionary-Derived Term (PT
).
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet03_main()
: Main TLG function -
aet03_pre()
: Preprocessing -
aet03_post()
: Postprocessing
Note
-
adam_db
object must contain anadae
table with the columns"AEBODSYS"
,"AEDECOD"
and"ASEV"
.
Examples
run(aet03, syn_data)
aet04
Layout
Description
aet04
Layout
Usage
aet04_lyt(
arm_var,
total_var,
lbl_overall,
lbl_aebodsys,
lbl_aedecod,
grade_groups
)
Arguments
arm_var |
( |
total_var |
( |
lbl_overall |
( |
lbl_aebodsys |
( |
lbl_aedecod |
( |
grade_groups |
( |
Value
a PreDataTableLayouts
object.
AET04
Table 1 (Default) Adverse Events by Highest NCI
CTACAE
AE
Grade Table 1.
Description
The AET04
table provides an
overview of adverse event with the highest NCI
CTCAE
grade per individual.
Usage
aet04_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
grade_groups = NULL,
...
)
aet04_pre(adam_db, ...)
aet04_post(tlg, prune_0 = TRUE, ...)
aet04
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
grade_groups |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Numbers represent absolute numbers of patients and fraction of
N
, or absolute number of event when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Events with missing grading values are excluded.
Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Sort Body System or Organ Class and Dictionary-Derived Term by highest overall frequencies. Analysis Toxicity Grade is sorted by severity.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet04_main()
: Main TLG function -
aet04_pre()
: Preprocessing -
aet04_post()
: Postprocessing
Note
-
adam_db
object must contain anadae
table with the columns"AEBODSYS"
,"AEDECOD"
and"ATOXGR"
.
Examples
grade_groups <- list(
"Grade 1-2" = c("1", "2"),
"Grade 3-4" = c("3", "4"),
"Grade 5" = c("5")
)
proc_data <- dunlin::log_filter(syn_data, AEBODSYS == "cl A.1", "adae")
run(aet04, proc_data, grade_groups = grade_groups)
AET05_ALL
Table 1 (Default) Adverse Event Rate Adjusted for Patient-Years at Risk - All Occurrences.
Description
The AET05_ALL
table produces the standard adverse event rate adjusted for patient-years at risk summary
considering all occurrences.
Usage
aet05_all_pre(adam_db, dataset = "adsaftte", ...)
aet05_all
Arguments
adam_db |
( |
dataset |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Value
the preprocessing function returns a list
of data.frame
.
Functions
-
aet05_all_pre()
: Preprocessing
Examples
library(dplyr)
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "AETOT1" | PARAMCD == "AEREPTTE", "adsaftte")
run(aet05_all, proc_data)
run(aet05_all, proc_data, conf_level = 0.90, conf_type = "exact")
aet05
Layout
Description
aet05
Layout
Usage
aet05_lyt(arm_var, lbl_overall, param_label, vars, n_events, control)
Arguments
arm_var |
( |
lbl_overall |
( |
param_label |
( |
vars |
( |
n_events |
( |
control |
( |
Value
a PreDataTableLayouts
object.
AET05
Table 1 (Default) Adverse Event Rate Adjusted for Patient-Years at Risk - First Occurrence.
Description
The AET05
table produces the standard adverse event rate adjusted for patient-years at risk summary
considering first occurrence.
Usage
aet05_main(
adam_db,
dataset = "adsaftte",
arm_var = "ACTARM",
lbl_overall = NULL,
...
)
aet05_pre(adam_db, dataset = "adsaftte", ...)
aet05_post(tlg, prune_0 = FALSE, ...)
aet05
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
lbl_overall |
( |
... |
Further arguments passed to |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Total patient-years at risk is the sum over all patients of the time intervals (in years).
Split columns by arm, typically
ACTARM
.Split rows by parameter code.
-
AVAL
is patient-years at risk. -
N_EVENTS
is the number of adverse events observed. The table allows confidence level to be adjusted, default is 95%.
Keep zero count rows by default.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet05_main()
: Main TLG function -
aet05_pre()
: Preprocessing -
aet05_post()
: Postprocessing
Note
-
adam_db
object must contain table named asdataset
with the columns"PARAMCD"
,"PARAM"
,"AVAL"
, and"CNSR"
.
Examples
library(dplyr)
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "AETTE1", "adsaftte")
run(aet05, proc_data)
run(aet05, proc_data, conf_level = 0.90, conf_type = "exact")
aet10
Layout
Description
aet10
Layout
Usage
aet10_lyt(arm_var, lbl_overall, lbl_aedecod)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_aedecod |
( |
Value
a PreDataTableLayouts
object.
AET10
Table 1 (Default) Most Common (xx%) Adverse Events Preferred Terms Table 1.
Description
The AET10
table Include Adverse Events occurring with user-specified threshold X% in at least
one of the treatment groups. Standard table summarized by preferred term (PT).
Order the data by total column frequency from most to least frequently reported PT (regardless of SOC).
Usage
aet10_main(adam_db, arm_var = "ACTARM", lbl_overall = NULL, ...)
aet10_pre(adam_db, ...)
aet10_post(tlg, atleast = 0.05, ...)
aet10
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
... |
not used. |
tlg |
( |
atleast |
given cut-off in numeric format, default is |
Format
An object of class chevron_t
of length 1.
Details
Numbers represent absolute numbers of subject and fraction of
N
, or absolute number of event when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort Dictionary-Derived Code (
AEDECOD
) by highest overall frequencies.Missing values in
AEDECOD
are labeled byNo Coding Available
.
Value
the main function returns an rtables
object
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
aet10_main()
: Main TLG function -
aet10_pre()
: Preprocessing -
aet10_post()
: Postprocessing
Note
-
adam_db
object must contain anadae
table with the columns"AEDECOD"
.
Examples
run(aet10, syn_data)
Analyze with defined precision
Description
Analyze with defined precision
Usage
afun_p(
x,
.N_col,
.spl_context,
precision,
.N_row,
.var = NULL,
.df_row = NULL,
.stats = NULL,
.labels = NULL,
.indent_mods = NULL,
...
)
Arguments
x |
value to analyze |
.N_col |
( |
.spl_context |
split context. |
precision |
(named |
.N_row |
( |
.var |
variable name. |
.stats |
(named |
.labels |
( |
.indent_mods |
( |
... |
additional arguments for |
Analyze skip baseline
Description
Analyze skip baseline
Usage
afun_skip(
x,
.var,
.spl_context,
paramcdvar,
visitvar,
skip,
precision,
.stats,
.labels = NULL,
.indent_mods = NULL,
.N_col,
.N_row,
...
)
Arguments
x |
value to analyze |
.var |
variable name. |
.spl_context |
split context. |
paramcdvar |
( |
visitvar |
( |
skip |
Named ( |
precision |
(named |
.stats |
( |
.labels |
( |
.indent_mods |
( |
.N_col |
( |
.N_row |
( |
... |
additional arguments for |
Get Arguments List
Description
Get Arguments List
Usage
args_ls(x, simplify = FALSE, omit = NULL)
## S4 method for signature 'chevron_tlg'
args_ls(x, simplify = FALSE, omit = NULL)
Arguments
x |
( |
simplify |
( |
omit |
( |
Value
a list
of the formal arguments with their default for the functions stored in the chevron_tlg
object
passed a x
argument.
Examples
args_ls(aet01, simplify = TRUE)
Check variable only has one unique value.
Description
Check variable only has one unique value.
Usage
assert_single_value(x, label = deparse(substitute(x)))
Arguments
x |
value vector. |
label |
( |
Value
invisible NULL
or an error message if the criteria are not fulfilled.
Check variable is of correct type
Description
Check variable is of correct type
Usage
assert_valid_type(x, types, label = deparse(substitute(x)))
Arguments
x |
Object to check the type. |
types |
( |
label |
( |
Value
invisible NULL
or an error message if the criteria are not fulfilled.
Check whether var is valid
Description
Check whether var is valid
Usage
assert_valid_var(x, label, na_ok, empty_ok, ...)
## S3 method for class 'character'
assert_valid_var(
x,
label = deparse(substitute(x)),
na_ok = FALSE,
empty_ok = FALSE,
min_chars = 1L,
...
)
## S3 method for class 'factor'
assert_valid_var(
x,
label = deparse(substitute(x)),
na_ok = FALSE,
empty_ok = FALSE,
min_chars = 1L,
...
)
## S3 method for class 'logical'
assert_valid_var(
x,
label = deparse(substitute(x)),
na_ok = TRUE,
empty_ok = FALSE,
...
)
## S3 method for class 'numeric'
assert_valid_var(
x,
label = deparse(substitute(x)),
na_ok = TRUE,
empty_ok = FALSE,
integerish = FALSE,
...
)
## S3 method for class 'POSIXct'
assert_valid_var(
x,
label = deparse(substitute(x)),
na_ok = TRUE,
empty_ok = FALSE,
tzs = OlsonNames(),
...
)
## Default S3 method:
assert_valid_var(
x,
label = deparse(substitute(x)),
na_ok = FALSE,
empty_ok = FALSE,
...
)
Arguments
x |
value of col_split variable |
label |
( |
na_ok |
( |
empty_ok |
( |
... |
Further arguments to methods. |
min_chars |
( |
integerish |
( |
tzs |
( |
Details
This function checks the variable values are valid or not.
Value
invisible NULL
or an error message if the criteria are not fulfilled.
Check variables are of same levels
Description
Check variables are of same levels
Usage
assert_valid_var_pair(
df1,
df2,
var,
lab1 = deparse(substitute(df1)),
lab2 = deparse(substitute(df2))
)
Arguments
df1 |
( |
df2 |
( |
var |
( |
lab1 |
( |
lab2 |
( |
Value
invisible NULL
or an error message if the criteria are not fulfilled.
Check variables in a data frame are valid character or factor.
Description
Check variables in a data frame are valid character or factor.
Usage
assert_valid_variable(
df,
vars,
label = deparse(substitute(df)),
types = NULL,
...
)
Arguments
df |
( |
vars |
( |
label |
( |
types |
Named ( |
... |
further arguments for |
Value
invisible TRUE
or an error message if the criteria are not fulfilled.
cfbt01
Layout
Description
cfbt01
Layout
Usage
cfbt01_lyt(
arm_var,
lbl_overall,
lbl_avisit,
lbl_param,
summaryvars,
summaryvars_lbls,
row_split_var,
row_split_lbl,
visitvar,
precision,
page_var,
.stats,
skip,
...
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_avisit |
( |
lbl_param |
( |
summaryvars |
( |
summaryvars_lbls |
( |
row_split_var |
( |
row_split_lbl |
( |
visitvar |
( |
precision |
(named |
page_var |
( |
.stats |
( |
skip |
Named ( |
... |
not used. |
Value
a PreDataTableLayouts
object.
CFBT01
Change from Baseline By Visit Table.
Description
The CFBT01
table provides an
overview of the actual values and its change from baseline of each respective arm
over the course of the trial.
Usage
cfbt01_main(
adam_db,
dataset,
arm_var = "ACTARM",
lbl_overall = NULL,
row_split_var = NULL,
summaryvars = c("AVAL", "CHG"),
visitvar = "AVISIT",
precision = list(default = 2L),
page_var = "PARAMCD",
.stats = c("n", "mean_sd", "median", "range"),
skip = list(CHG = "BASELINE"),
...
)
cfbt01_pre(adam_db, dataset, ...)
cfbt01_post(tlg, prune_0 = TRUE, ...)
cfbt01
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
summaryvars |
( |
visitvar |
( |
precision |
(named |
page_var |
( |
.stats |
( |
skip |
Named ( |
... |
additional arguments like |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
The
Analysis Value
column, displays the number of patients, the mean, standard deviation, median and range of the analysis value for each visit.The
Change from Baseline
column, displays the number of patient and the mean, standard deviation, median and range of changes relative to the baseline.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Sorted based on factor level; first by
PARAM
labels in alphabetic order then by chronological time point given byAVISIT
. Re-level to customize order
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
cfbt01_main()
: Main TLG function -
cfbt01_pre()
: Preprocessing -
cfbt01_post()
: Postprocessing
Note
-
adam_db
object must contain table named asdataset
with the columns specified insummaryvars
.
Examples
library(dunlin)
proc_data <- log_filter(
syn_data,
PARAMCD %in% c("DIABP", "SYSBP"), "advs"
)
run(cfbt01, proc_data, dataset = "advs")
Check that all names are among column names
Description
Check that all names are among column names
Usage
check_all_colnames(df, x, null_ok = TRUE, qualifier = NULL)
Arguments
df |
( |
x |
( |
null_ok |
( |
qualifier |
( |
Value
invisible NULL
or a string if the criteria are not fulfilled.
Check that at least one name is among column names
Description
Check that at least one name is among column names
Usage
check_one_colnames(df, x, null_ok = TRUE, qualifier = NULL)
Arguments
df |
( |
x |
( |
null_ok |
( |
qualifier |
( |
Value
invisible NULL
or a string if the criteria are not fulfilled.
chevron_tlg
class
Description
The chevron_tlg
S4 class associates a preprocess
function, a main tlg
function and a postprocess
function.
chevron_t
, a subclass of chevron_tlg with specific validation criteria to handle table creation
chevron_l
, a subclass of chevron_tlg with specific validation criteria to handle listing creation
chevron_g
, a subclass of chevron_tlg with specific validation criteria to handle graph creation
chevron_simple
, a subclass of chevron_tlg, where main function is a simple call
Usage
chevron_t(
main = function(adam_db, ...) build_table(basic_table(), adam_db[[1]]),
preprocess = function(adam_db, ...) adam_db,
postprocess = std_postprocessing,
dataset = NULL,
...
)
chevron_l(
main = function(adam_db, ...) data.frame(),
preprocess = function(adam_db, ...) adam_db,
postprocess = std_postprocessing,
dataset = NULL,
...
)
chevron_g(
main = function(adam_db, ...) ggplot2::ggplot(),
preprocess = function(adam_db, ...) adam_db,
postprocess = std_postprocessing,
dataset = NULL,
...
)
chevron_simple()
Arguments
main |
( |
preprocess |
( |
postprocess |
( |
dataset |
( |
... |
not used |
Value
a chevron_t
class object.
a chevron_l
class object.
a chevron_g
class object.
a chevron_simple
class object.
Slots
main
(
function
) returning atlg
. Typically one of the*_main
function fromchevron
.preprocess
(
function
) returning a pre-processedlist
ofdata.frames
amenable totlg
creation. Typically one of the*_pre
function fromchevron
.postprocess
(
function
) returning a post-processedtlg
. Typically one of the*_post
function fromchevron
.dataset
(
character
) the names of the data sets used in thechevron_tlg
object. IfNULL
, all data sets are possibly used.
Note
To ensure the correct execution of the workflow, additional validation criteria are:
the first argument of the
main
function must beadam_db
, the inputlist
ofdata.frames
to pre-process. The...
argument is mandatory.the first argument of the
preprocess
function must beadam_db
, the inputlist
ofdata.frames
to createtlg
output. The...
argument is mandatory.the first argument of the
postprocess
function must betlg
, the inputTableTree
object to post-process. The...
argument is mandatory.
Examples
chevron_t_obj <- chevron_t()
chevron_t_obj <- chevron_t(postprocess = function(tlg, indent, ...) {
rtables::table_inset(tlg) <- indent
tlg
})
chevron_l_obj <- chevron_l()
chevron_g_obj <- chevron_g()
chevron_g_obj <- chevron_g(
postprocess = function(tlg, title, ...) tlg + ggplot2::labs(main = title)
)
chevron_simple_obj <- chevron_simple()
CML02A_GL
Listing 1 (Default) Concomitant Medication Class Level 2, Preferred Name, and Investigator-Specified
Terms.
Description
CML02A_GL
Listing 1 (Default) Concomitant Medication Class Level 2, Preferred Name, and Investigator-Specified
Terms.
Usage
cml02a_gl_main(
adam_db,
dataset = "adcm",
key_cols = c("ATC2", "CMDECOD"),
disp_cols = c("ATC2", "CMDECOD", "CMTRT"),
split_into_pages_by_var = NULL,
unique_rows = TRUE,
...
)
cml02a_gl_pre(
adam_db,
dataset = "adcm",
disp_cols = c("ATC2", "CMDECOD", "CMTRT"),
...
)
cml02a_gl
Arguments
adam_db |
( |
dataset |
( |
key_cols |
( |
disp_cols |
( |
split_into_pages_by_var |
( |
unique_rows |
( |
... |
not used. |
Format
An object of class chevron_l
of length 1.
Value
the main function returns an rlistings
or a list
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
cml02a_gl_main()
: Main TLG function -
cml02a_gl_pre()
: Preprocessing
Examples
run(cml02a_gl, syn_data)
CMT01A
Concomitant Medication by Medication Class and Preferred Name.
Description
A concomitant medication table with the number of subjects and the total number of treatments by medication class.
Usage
cmt01_label
cmt01a_main(
adam_db,
arm_var = "ARM",
lbl_overall = NULL,
row_split_var = "ATC2",
medname_var = "CMDECOD",
summary_labels = setNames(rep(list(cmt01_label), length(row_split_var) + 1L),
c("TOTAL", row_split_var)),
...
)
cmt01a_pre(adam_db, ...)
cmt01a_post(
tlg,
prune_0 = TRUE,
sort_by_freq = FALSE,
row_split_var = "ATC2",
medname_var = "CMDECOD",
...
)
cmt01a
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
medname_var |
( |
summary_labels |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
sort_by_freq |
( |
Format
An object of class character
of length 2.
An object of class chevron_t
of length 1.
Details
Data should be filtered for concomitant medication.
(ATIREL == "CONCOMITANT")
.Numbers represent absolute numbers of subjects and fraction of
N
, or absolute numbers when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort by medication class alphabetically and within medication class by decreasing total number of patients with the specific medication.
summary_labels
is used to control the summary for each level. If "all" is used, then each split will have that summary statistic with the labels. One special case is "TOTAL", this is for the overall population.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
cmt01_label
: Default labels -
cmt01a_main()
: Main TLG function -
cmt01a_pre()
: Preprocessing -
cmt01a_post()
: Postprocessing
Note
-
adam_db
object must contain anadcm
table with the columns specified inrow_split_var
andmedname_var
as well as"CMSEQ"
.
Examples
library(dplyr)
proc_data <- syn_data
proc_data$adcm <- proc_data$adcm %>%
filter(ATIREL == "CONCOMITANT")
run(cmt01a, proc_data)
CMT02_PT
Table 1 (Default) Concomitant Medications by Preferred Name.
Description
A concomitant medication table with the number of subjects and the total number of treatments by medication name sorted by frequencies.
Usage
cmt02_pt_main(
adam_db,
arm_var = "ARM",
lbl_overall = NULL,
row_split_var = NULL,
medname_var = "CMDECOD",
summary_labels = list(TOTAL = cmt01_label),
...
)
cmt02_pt_pre(adam_db, ...)
cmt02_pt_post(
tlg,
prune_0 = TRUE,
sort_by_freq = FALSE,
row_split_var = NULL,
medname_var = "CMDECOD",
...
)
cmt02_pt
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
medname_var |
( |
summary_labels |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
sort_by_freq |
( |
Format
An object of class chevron_t
of length 1.
Details
Data should be filtered for concomitant medication.
(ATIREL == "CONCOMITANT")
.Numbers represent absolute numbers of subjects and fraction of
N
, or absolute numbers when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort by medication class alphabetically and within medication class by decreasing total number of patients with the specific medication.
summary_labels
is used to control the summary for each level. If "all" is used, then each split will have that summary statistic with the labels. One special case is "TOTAL", this is for the overall population.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
cmt02_pt_main()
: Main TLG function -
cmt02_pt_pre()
: Preprocessing -
cmt02_pt_post()
: Postprocessing
Note
-
adam_db
object must contain anadcm
table with the columns specified inrow_split_var
andmedname_var
as well as"CMSEQ"
.
Examples
run(cmt02_pt, syn_data)
Helper function to convert to months if needed
Description
Helper function to convert to months if needed
Usage
convert_to_month(x, unit)
Arguments
x |
( |
unit |
( |
Value
A numeric
vector with the time in months.
Count Children
Description
Count Children
Usage
count_children(x)
Count or summarize by groups
Description
Count or summarize by groups
Usage
count_or_summarize(lyt, var, level, detail_vars, indent_mod = 0L, ...)
Arguments
lyt |
( |
var |
( |
level |
( |
detail_vars |
( |
Count patients recursively
Description
Count patients recursively
Usage
count_patients_recursive(lyt, anl_vars, anl_lbls, lbl_vars)
Arguments
lyt |
( |
anl_vars |
Named ( |
anl_lbls |
( |
lbl_vars |
Named ( |
COXT01
Layout
Description
COXT01
Layout
Usage
coxt01_lyt(variables, col_split, lbl_vars, control, multivar, ...)
Arguments
variables |
( |
lbl_vars |
( |
multivar |
( |
... |
Further arguments passed to |
Value
a PreDataTableLayouts
object.
COXT01
(Default) Cox Regression Model Table.
Description
Cox models are the most commonly used methods to estimate the magnitude of the effect in survival analyses. It assumes proportional hazards; that is, it assumes that the ratio of the hazards of the two groups (e.g. two arms) is constant over time. This ratio is referred to as the "hazard ratio" and is one of the most commonly reported metrics to describe the effect size in survival analysis.
Usage
coxt01_main(
adam_db,
arm_var = "ARM",
time_var = "AVAL",
event_var = "EVENT",
covariates = c("SEX", "RACE", "AAGE"),
strata = NULL,
lbl_vars = "Effect/Covariate Included in the Model",
multivar = FALSE,
...
)
coxt01_pre(adam_db, arm_var = "ARM", ...)
coxt01_post(tlg, prune_0 = FALSE, ...)
coxt01
Arguments
adam_db |
( |
arm_var |
( |
time_var |
( |
event_var |
( |
covariates |
( |
strata |
( |
lbl_vars |
( |
multivar |
( |
... |
Further arguments passed to |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
The reference arm will always the first level of
arm_var
. Please change the level if you want to change the reference arms.The table allows confidence level to be adjusted, default is two-sided 95%.
The stratified analysis is with DISCRETE tie handling (equivalent to
tern::control_coxreg(ties = "exact")
in R).Model includes treatment plus specified covariate(s) as factor(s) or numeric(s), with
"SEX"
,"RACE"
and"AAGE"
as default candidates.The selection of the covariates and whether or not there is a selection process (vs. a fixed, pre-specified list) needs to be pre-specified.
For pairwise comparisons using the hazard ratio, the value for the control group is the denominator.
Keep zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
coxt01_main()
: Main TLG function -
coxt01_pre()
: Preprocessing -
coxt01_post()
: Postprocessing
Note
-
adam_db
object must contain anadtte
table with"PARAMCD"
,"ARM"
,"AVAL"
,"CNSR
, and the columns specified by"covariates"
which is denoted asc("SEX", "RACE", "AAGE")
by default.
Examples
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "CRSD", "adtte")
proc_data <- log_filter(proc_data, ARMCD != "ARM C", "adsl")
run(coxt01, proc_data)
run(coxt01, proc_data, covariates = c("SEX", "AAGE"), strata = c("RACE"), conf_level = 0.90)
COXT02
Multi-Variable Cox Regression Model Table.
Description
The COXT02
table follows the same principles as the general Cox model analysis
and produces the estimates for each of the covariates included in the model
(usually the main effects without interaction terms).
Usage
coxt02_main(
adam_db,
arm_var = "ARM",
time_var = "AVAL",
event_var = "EVENT",
covariates = c("SEX", "RACE", "AAGE"),
strata = NULL,
lbl_vars = "Effect/Covariate Included in the Model",
multivar = TRUE,
...
)
coxt02
Arguments
adam_db |
( |
arm_var |
( |
time_var |
( |
event_var |
( |
covariates |
( |
strata |
( |
lbl_vars |
( |
multivar |
( |
... |
Further arguments passed to |
Format
An object of class chevron_t
of length 1.
Details
The reference arm will always the first level of
arm_var
. Please change the level if you want to change the reference arms.The table allows confidence level to be adjusted, default is two-sided 95%.
The stratified analysis is with DISCRETE tie handling (equivalent to
tern::control_coxreg(ties = "exact")
in R).Model includes treatment plus specified covariate(s) as factor(s) or numeric(s), with
"SEX"
,"RACE"
and"AAGE"
as default candidates.The selection of the covariates and whether or not there is a selection process (vs. a fixed, pre-specified list) needs to be pre-specified.
For pairwise comparisons using the hazard ratio, the value for the control group is the denominator.
Keep zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
Functions
-
coxt02_main()
: Main TLG function
Note
-
adam_db
object must contain anadtte
table with"PARAMCD"
,"ARM"
,"AVAL"
,"CNSR
, and the columns specified by"covariates"
which is denoted asc("SEX", "RACE", "AAGE")
by default.
Examples
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "CRSD", "adtte")
run(coxt02, proc_data)
run(coxt02, proc_data, covariates = c("SEX", "AAGE"), strata = c("RACE"), conf_level = 0.90)
Concatenate Site and Subject ID
Description
Concatenate Site and Subject ID
Usage
create_id_listings(site, subject, sep = "/")
Arguments
site |
( |
subject |
( |
sep |
( |
Note
the {Patient_label}
whisker placeholder will be used in the label.
Examples
create_id_listings("BRA-1", "xxx-1234")
CTC version 4 Grade Direction Data
Description
CTC version 4 Grade Direction Data
Usage
ctcv4_dir
Format
An object of class data.frame
with 35 rows and 3 columns.
CTC version 5 Grade Direction Data
Description
CTC version 5 Grade Direction Data
Usage
ctcv5_dir
Format
An object of class data.frame
with 35 rows and 3 columns.
Data Set
Description
retrieve or set dataset
slot.
Usage
dataset(x)
## S4 method for signature 'chevron_tlg'
dataset(x)
dataset(x) <- value
## S4 replacement method for signature 'chevron_tlg'
dataset(x) <- value
Arguments
x |
( |
value |
( |
Value
the character
stored in the dataset
slot of the x
argument.
Deparse print
Description
Deparse print
Usage
deparse_print(x, indent, max_line = getOption("chevron.arg_max_line", 5L))
dmt01
Layout
Description
dmt01
Layout
Usage
dmt01_lyt(
arm_var,
lbl_overall,
summaryvars,
summaryvars_lbls,
stats,
precision
)
Arguments
arm_var |
( |
lbl_overall |
( |
summaryvars_lbls |
( |
Value
a PreDataTableLayouts
object.
DMT01
Table 1 (Default) Demographics and Baseline Characteristics Table 1.
Description
For each variable, summary statistics are
by default based on the number of patients in the corresponding n
row.
Usage
dmt01_main(
adam_db,
arm_var = "ARM",
lbl_overall = "All {Patient_label}",
summaryvars = c("AAGE", "AGEGR1", "SEX", "ETHNIC", "RACE"),
stats = list(default = c("n", "mean_sd", "median", "range", "count_fraction")),
precision = list(),
...
)
dmt01_pre(adam_db, ...)
dmt01_post(tlg, prune_0 = TRUE, ...)
dmt01
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
summaryvars |
( |
stats |
(named |
precision |
(named |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Information from
ADSUB
are generally included intoADSL
before analysis.Default demographic and characteristics table
If not specified otherwise, numbers represent absolute numbers of patients and fraction of
N
Remove zero-count rows
Split columns by arm (planned or actual / code or description)
Include a total column by default
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
dmt01_main()
: Main TLG function -
dmt01_pre()
: Preprocessing -
dmt01_post()
: Postprocessing
Note
-
adam_db
object must contain anadsl
table with the columns specified insummaryvars
.
Examples
run(dmt01, syn_data)
Execute a function call
Description
Execute a function call
Usage
do_call(what, args)
Dose Change Rule
Description
Dose Change Rule
Usage
dose_change_rule
Format
An object of class rule
(inherits from character
) of length 9.
dst01
Layout
Description
dst01
Layout
Usage
dst01_lyt(arm_var, lbl_overall, study_status_var, detail_vars, trt_status_var)
Arguments
arm_var |
( |
lbl_overall |
( |
study_status_var |
( |
detail_vars |
Named ( |
trt_status_var |
( |
Value
a PreDataTableLayouts
object.
DST01 Table 1 (Default) Patient Disposition Table 1.
Description
The DST01 Disposition Table provides an overview of patients study completion. For patients who discontinued the study a reason is provided.
Usage
dst01_main(
adam_db,
arm_var = "ARM",
lbl_overall = "All {Patient_label}",
study_status_var = "EOSSTT",
detail_vars = list(Discontinued = c("DCSREAS")),
trt_status_var = NULL,
...
)
dst01_pre(adam_db, ...)
dst01_post(tlg, prune_0 = TRUE, ...)
dst01
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
study_status_var |
( |
detail_vars |
Named ( |
trt_status_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Default patient disposition table summarizing the reasons for patients withdrawal.
Numbers represent absolute numbers of patients and fraction of
N
.Remove zero-count rows.
Split columns by arm.
Include a total column by default.
Sort withdrawal reasons by alphabetic order.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
dst01_main()
: Main TLG function -
dst01_pre()
: Preprocessing -
dst01_post()
: Postprocessing
Note
-
adam_db
object must contain anadsl
table with the columns specified bystatus_var
anddisc_reason_var
.
Examples
run(dst01, syn_data, detail_vars = list(Ongoing = "STDONS"))
run(dst01, syn_data, detail_vars = list(Discontinued = "DCSREAS", Ongoing = "STDONS"))
run(
dst01, syn_data,
detail_vars = list(
Discontinued = c("DCSREASGP", "DCSREAS"),
Ongoing = "STDONS"
)
)
dtht01
Layout
Description
dtht01
Layout
Usage
dtht01_lyt(
arm_var,
lbl_overall,
death_flag,
death_var,
other_level,
other_var,
dose_death_var
)
Arguments
arm_var |
( |
lbl_overall |
( |
death_flag |
( |
death_var |
( |
other_level |
( |
other_var |
( |
dose_death_var |
( |
Value
a PreDataTableLayouts
object.
DTHT01
Table 1 (Default) Death Table.
Description
A description of the causes of death optionally with the breakdown of the
OTHER
category and/or post-study reporting of death.
Usage
dtht01_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
other_category = FALSE,
time_since_last_dose = FALSE,
...
)
dtht01_pre(adam_db, ...)
dtht01_post(tlg, prune_0 = TRUE, ...)
dtht01
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
other_category |
( |
time_since_last_dose |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Numbers represent absolute numbers of subjects and fraction of
N
, or absolute numbers when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Does not include a total column by default.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
dtht01_main()
: Main TLG function -
dtht01_pre()
: Preprocessing -
dtht01_post()
: Postprocessing
Note
-
adam_db
object must contain anadsl
table with the columns"DTHFL"
,"DTHCAT"
as well asLDDTHGR1
iftime_since_last_dose
isTRUE
.
Examples
run(dtht01, syn_data)
run(dtht01, syn_data, other_category = TRUE, time_since_last_dose = TRUE)
Dummy template.
Description
This template creates a dummy output.
Usage
dummy_template
Format
An object of class chevron_simple
of length 1.
Examples
run(dummy_template, syn_data)
EGT01
ECG Parameters and Change from Baseline By Visit Table.
Description
The EGT01
table provides an
overview of the ECG values and its change from baseline of each respective arm
over the course of the trial.
Usage
egt01_main(
adam_db,
dataset = "adeg",
arm_var = "ACTARM",
lbl_overall = NULL,
row_split_var = NULL,
summaryvars = c("AVAL", "CHG"),
visitvar = "AVISIT",
precision = list(default = 0L),
page_var = "PARAMCD",
.stats = c("n", "mean_sd", "median", "range"),
skip = list(CHG = "BASELINE"),
...
)
egt01_pre(adam_db, dataset = "adeg", ...)
egt01
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
summaryvars |
( |
visitvar |
( |
precision |
(named |
page_var |
( |
.stats |
( |
skip |
Named ( |
... |
additional arguments like |
Format
An object of class chevron_t
of length 1.
Details
The
Analysis Value
column, displays the number of patients, the mean, standard deviation, median and range of the analysis value for each visit.The
Change from Baseline
column, displays the number of patient and the mean, standard deviation, median and range of changes relative to the baseline.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Sorted based on factor level; first by
PARAM
labels in alphabetic order then by chronological time point given byAVISIT
. Re-level to customize order
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
egt01_main()
: Main TLG function -
egt01_pre()
: Preprocessing
Note
default precision is 0.
Examples
run(egt01, syn_data)
EGT02
ECG Abnormalities Table.
Description
ECG Parameters outside Normal Limits Regardless of Abnormality at Baseline Table.
Usage
egt02_1_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
exclude_base_abn = FALSE,
...
)
egt02_pre(adam_db, ...)
egt02_post(tlg, ...)
egt02_1
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
exclude_base_abn |
( |
... |
not used. |
tlg |
( |
Format
An object of class chevron_t
of length 1.
Details
Only count LOW or HIGH values.
Results of "LOW LOW" are treated as the same as "LOW", and "HIGH HIGH" the same as "HIGH".
Does not include a total column by default.
Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
egt02_1_main()
: Main TLG function -
egt02_pre()
: Preprocessing -
egt02_post()
: Postprocessing
Note
-
adam_db
object must contain anadeg
table with the"PARAM"
,"ANRIND"
and"BNRIND"
columns.
Examples
run(egt02_1, syn_data)
EGT02_2
ECG Abnormalities Table.
Description
ECG Parameters outside Normal Limits Among Patients without Abnormality at Baseline Table.
Usage
egt02_2_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
exclude_base_abn = TRUE,
...
)
egt02_2
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
exclude_base_abn |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Details
Only count LOW or HIGH values.
Results of "LOW LOW" are treated as the same as "LOW", and "HIGH HIGH" the same as "HIGH".
Does not include a total column by default.
Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
egt02_2_main()
: Main TLG function
Note
-
adam_db
object must contain anadeg
table with the"PARAM"
,"ANRIND"
and"BNRIND"
columns.
Examples
run(egt02_2, syn_data)
egt02
Layout
Description
egt02
Layout
Usage
egt02_lyt(
arm_var = "ACTARM",
lbl_overall,
lbl_vs_assessment = "Assessment",
lbl_vs_abnormality = "Abnormality",
exclude_base_abn
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_vs_assessment |
( |
lbl_vs_abnormality |
( |
exclude_base_abn |
( |
Value
a PreDataTableLayouts
object.
egt03
Layout
Description
egt03
Layout
Usage
egt03_lyt(
arm_var,
splitvar,
summaryvar,
lbl_armvar,
lbl_summaryvars,
lbl_param,
page_var
)
Arguments
arm_var |
( |
splitvar |
( |
summaryvar |
( |
lbl_armvar |
( |
lbl_summaryvars |
( |
page_var |
( |
Value
a PreDataTableLayouts
object.
EGT03
Shift Table of ECG Interval Data - Baseline versus Minimum or Maximum Post-Baseline.
Description
The EGT03
Table entries provide the number of patients by baseline assessment and minimum or maximum post-baseline
assessment. Percentages are based on the total number of patients in a treatment group. Baseline is the patient's
last observation prior to initiation of study drug.
Usage
egt03_main(
adam_db,
arm_var = "ACTARMCD",
summaryvar = "BNRIND",
splitvar = "ANRIND",
visitvar = "AVISIT",
page_var = "PARAMCD",
...
)
egt03_pre(adam_db, ...)
egt03_post(tlg, prune_0 = FALSE, ...)
egt03
Arguments
adam_db |
( |
arm_var |
( |
summaryvar |
( |
splitvar |
( |
visitvar |
( |
page_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
-
ADEG
data are subsetted to contain only "POST-BASELINE MINIMUM"/"POST-BASELINE MAXIMUM" visit according to the preprocessing. Percentages are based on the total number of patients in a treatment group.
Split columns by Analysis Reference Range Indicator, typically
ANRIND
.Does not include a total column by default.
Sorted based on factor level.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
egt03_main()
: Main TLG function -
egt03_pre()
: Preprocessing -
egt03_post()
: Postprocessing
Note
-
adam_db
object must contain anadeg
table with a"ACTARMCD"
column as well as columns specified insummaryvar
andsplitvar
.
Examples
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "HR", "adeg")
run(egt03, proc_data)
EGT05_QTCAT
Layout
Description
EGT05_QTCAT
Layout
Usage
egt05_qtcat_lyt(
arm_var,
lbl_overall,
lbl_avisit,
lbl_param,
lbl_cat,
summaryvars,
summaryvars_lbls,
row_split_var,
row_split_lbl,
visitvar,
page_var
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_avisit |
( |
lbl_param |
( |
lbl_cat |
( |
summaryvars |
( |
summaryvars_lbls |
( |
row_split_var |
( |
visitvar |
( |
page_var |
( |
Value
a PreDataTableLayouts
object.
EGT05_QTCAT
ECG Actual Values and Changes from Baseline by Visit Table.
Description
The EGT05_QTCAT
table summarizes several electrocardiogram parameters and their evolution
throughout the study.
Usage
egt05_qtcat_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
summaryvars = c("AVALCAT1", "CHGCAT1"),
row_split_var = NULL,
visitvar = "AVISIT",
page_var = NULL,
...
)
egt05_qtcat_pre(adam_db, ...)
egt05_qtcat_post(tlg, prune_0 = TRUE, ...)
egt05_qtcat
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
summaryvars |
( |
row_split_var |
( |
visitvar |
( |
page_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
The
Value at Visit
column, displays the categories of the specific"PARAMCD"
value for patients.The
Change from Baseline
column, displays the categories of the specific"PARAMCD"
value change from baseline for patients.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm, typically
"ACTARM"
.Does not include a total column by default.
Sorted based on factor level; by chronological time point given by
"AVISIT"
or user-defined visit incorporating"ATPT"
. Re-level to customize order.Please note that it is preferable to convert
summaryvars
to factor.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
egt05_qtcat_main()
: Main TLG function -
egt05_qtcat_pre()
: Preprocessing -
egt05_qtcat_post()
: Postprocessing
Note
-
adam_db
object must contain anadeg
table with column specified invisitvar
. Forsummaryvars
, please make sureAVALCAT1
andCHGCAT1
columns existed in input data sets.
Examples
run(egt05_qtcat, syn_data)
Empty rule
Description
Empty rule
Usage
empty_rule
Format
An object of class rule
(inherits from character
) of length 0.
Execute function with given arguments
Description
Execute function with given arguments
Usage
execute_with_args(fun, ...)
Details
If the function has ...
, this function will not pass other arguments to ...
.
Only named arguments are passed.
Expand list to each split
Description
Expand list to each split
Usage
expand_list(lst, split)
ext01
Layout
Description
ext01
Layout
Usage
ext01_lyt(
arm_var,
lbl_overall,
summaryvars,
summaryvars_lbls,
row_split_var,
row_split_lbl,
page_var,
map,
stats = list(default = c("n", "mean_sd", "median", "range", "count_fraction")),
precision = list()
)
Arguments
arm_var |
( |
lbl_overall |
( |
summaryvars |
( |
summaryvars_lbls |
( |
row_split_var |
( |
page_var |
( |
Value
a PreDataTableLayouts
object.
EXT01
Exposure Summary Table.
Description
The EXT01
table provides an overview of the of the exposure of the
patients in terms of Total dose administered or missed, and treatment duration.
Usage
ext01_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
summaryvars = "AVAL",
row_split_var = "PARCAT2",
page_var = NULL,
map = NULL,
stats = list(default = c("n", "mean_sd", "median", "range", "count_fraction")),
precision = list(default = 0),
...
)
ext01_pre(adam_db, ...)
ext01_post(tlg, prune_0 = TRUE, ...)
ext01
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
summaryvars |
( |
row_split_var |
( |
page_var |
( |
map |
( |
stats |
(named |
precision |
(named |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Default Exposure table
The
n
row provides the number of non-missing values. The percentages for categorical variables is based onn
. The percentages forTotal number of patients with at least one dose modification
are based on the number of patients in the corresponding analysis population given byN
.Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Sorted by alphabetic order of the
PARAM
value. Transform to factor and re-level for custom order.-
ANL01FL
is not relevant subset.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
ext01_main()
: Main TLG function -
ext01_pre()
: Preprocessing -
ext01_post()
: Postprocessing
Note
-
adam_db
object must contain anadex
table with columns specified insummaryvars
.
Examples
run(ext01, syn_data)
run(ext01, syn_data, summaryvars = c("AVAL", "AVALCAT1"), prune_0 = FALSE)
levels(syn_data$adex$AVALCAT1) <- c(levels(syn_data$adex$AVALCAT1), "12 months")
map <- data.frame(
PARAMCD = "TDURD",
AVALCAT1 = c("< 1 month", "1 to <3 months", ">=6 months", "3 to <6 months", "12 months")
)
run(
ext01,
syn_data,
summaryvars = c("AVAL", "AVALCAT1"),
prune_0 = FALSE,
map = map,
precision = list(TDOSE = 4, default = 4),
stats = list(TDURD = "n", default = c("n", "count_fraction"))
)
Formatting of date
Description
Formatting of date
Usage
format_date(date_format = "%d%b%Y")
Arguments
date_format |
( |
Value
a function
converting a date into string
.
Note
The date is extracted at the location of the measure, not at the location of the system.
Examples
format_date("%d%b%Y")(as.Date("2021-01-01"))
if ("NZ" %in% OlsonNames()) {
format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "NZ"))
}
if ("US/Pacific" %in% OlsonNames()) {
format_date("%d%b%Y")(as.POSIXct("2021-01-01 00:00:01", tz = "US/Pacific"))
}
FSTG01
Subgroup Analysis of Best Overall Response.
Description
The template produces the subgroup analysis of best overall response graphic.
Usage
fstg01_main(
adam_db,
dataset = "adrs",
arm_var = "ARM",
rsp_var = "IS_RSP",
subgroups = c("SEX", "AGEGR1", "RACE"),
strata_var = NULL,
stat_var = c("n_tot", "n", "n_rsp", "prop", "or", "ci"),
...
)
fstg01_pre(adam_db, ...)
fstg01
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
rsp_var |
( |
subgroups |
( |
strata_var |
( |
stat_var |
( |
... |
Further arguments passed to |
Format
An object of class chevron_g
of length 1.
Details
No overall value.
Keep zero count rows by default.
Value
the main function returns a grob
object.
a gTree
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
fstg01_main()
: Main TLG Function -
fstg01_pre()
: Preprocessing
Note
-
adam_db
object must contain the table specified bydataset
with"PARAMCD"
,"ARM"
,"AVALC"
, and the columns specified bysubgroups
which is denoted asc("SEX", "AGEGR1", "RACE")
by default. If the plot is too large to be rendered in the output, please provide
gp
,width_row_names
,width_columns
andwidth_forest
manually to make it fit. Seetern::g_forest
for more details.
Examples
library(dplyr)
library(dunlin)
proc_data <- log_filter(
syn_data,
PARAMCD == "BESRSPI" & ARM %in% c("A: Drug X", "B: Placebo"), "adrs"
)
run(fstg01, proc_data,
subgroups = c("SEX", "AGEGR1", "RACE"),
conf_level = 0.90, dataset = "adrs"
)
FSTG02
Subgroup Analysis of Survival Duration.
Description
The template produces the subgroup analysis of survival duration graphic.
Usage
fstg02_main(
adam_db,
dataset = "adtte",
arm_var = "ARM",
subgroups = c("SEX", "AGEGR1", "RACE"),
strata_var = NULL,
stat_var = c("n_tot", "n", "median", "hr", "ci"),
...
)
fstg02_pre(adam_db, ...)
fstg02
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
subgroups |
( |
strata_var |
( |
stat_var |
( |
... |
Further arguments passed to |
Format
An object of class chevron_g
of length 1.
Details
No overall value.
Keep zero count rows by default.
Value
the main function returns a gTree
object.
a gTree
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
fstg02_main()
: Main TLG Function -
fstg02_pre()
: Preprocessing
Note
-
adam_db
object must contain the table specified bydataset
with"PARAMCD"
,"ARM"
,"AVAL"
,"AVALU"
,"CNSR"
, and the columns specified bysubgroups
which is denoted asc("SEX", "AGEGR1", "RACE")
by default. If the plot is too large to be rendered in the output, please refer to
FSTG01
.
Examples
library(dplyr)
library(dunlin)
proc_data <- log_filter(
syn_data,
PARAMCD == "OS" & ARM %in% c("A: Drug X", "B: Placebo"), "adtte"
)
run(fstg02, proc_data,
subgroups = c("SEX", "AGEGR1", "RACE"),
conf_level = 0.90, dataset = "adtte"
)
Fuse list elements
Description
Fuse list elements
Usage
fuse_sequentially(x, y)
Arguments
x |
( |
y |
( |
General Argument Name Convention
Description
General Argument Name Convention
Usage
gen_args(
adam_db,
main,
preprocess,
postprocess,
dataset,
type,
arm_var,
lbl_overall,
prune_0,
req_tables,
deco,
group,
tlg,
visitvar,
visit_value,
paramcd_value,
key_cols,
disp_cols,
row_split_var,
split_into_pages_by_var,
page_var,
unique_rows,
...
)
Arguments
adam_db |
( |
main |
( |
preprocess |
( |
postprocess |
( |
dataset |
( |
type |
( |
arm_var |
( |
lbl_overall |
( |
prune_0 |
( |
req_tables |
( |
deco |
( |
group |
( |
tlg |
( |
visitvar |
( |
visit_value |
Value of visit variable. |
paramcd_value |
Value of |
key_cols |
( |
disp_cols |
( |
row_split_var |
( |
split_into_pages_by_var |
( |
page_var |
( |
unique_rows |
( |
... |
not used. |
Details
the following arguments are better provided through the study object: lbl_overall
, arm_var
.
Value
invisible NULL
. This function is for documentation purpose only.
Get grade rule
Description
Get grade rule
Usage
get_grade_rule(direction = "high", missing = "incl")
Arguments
direction |
( |
missing |
( |
Value
a rule
object.
Get page by value
Description
Get page by value
Usage
get_page_by(var, vars)
Get Section dividers
Description
Get Section dividers
Usage
get_section_div()
Value
(character
) value with section dividers at corresponding section.
Subset Arguments and Merge
Description
Subset Arguments and Merge
Usage
get_subset(x, y)
Get a harmonious value of horizontal justification for x axis
Description
Get a harmonious value of horizontal justification for x axis
Usage
get_x_hjust(x)
Arguments
x |
( |
Get a harmonious value of vertical justification for x axis
Description
Get a harmonious value of vertical justification for x axis
Usage
get_x_vjust(x)
Arguments
x |
( |
List of gg
object
Description
Usage
gg_list(...)
Arguments
... |
( |
Value
a gg_list
object.
Theme for Chevron Plot
Description
Theme for Chevron Plot
Usage
gg_theme_chevron(
grid_y = TRUE,
grid_x = FALSE,
legend_position = "top",
text_axis_x_rot = 45
)
Arguments
grid_y |
( |
grid_x |
( |
legend_position |
( |
text_axis_x_rot |
( |
Value
a theme
object.
List of grob
object
Description
Usage
grob_list(...)
Arguments
... |
( |
Value
a grob_list
object.
Decimal formatting
Description
Decimal formatting
Usage
h_format_dec(digits, format, ne = NULL)
Arguments
digits |
( |
format |
( |
ne |
( |
Value
function
formatting numbers with the defined format.
Examples
fun <- h_format_dec(c(1, 1), "%s - %s")
fun(c(123, 567.89))
Helper Function Extracting Layout Functions
Description
Helper Function Extracting Layout Functions
Usage
h_unwrap_layout(x, pattern)
Helper function to add a column split if specified
Description
Helper function to add a column split if specified
Usage
ifneeded_split_col(lyt, var, ...)
Arguments
lyt |
( |
var |
( |
... |
Additional arguments for |
Value
rtables
object.
Helper function to add a row split if specified
Description
Helper function to add a row split if specified
Usage
ifneeded_split_row(lyt, var, lbl_var)
Arguments
lyt |
( |
var |
( |
lbl_var |
( |
Value
PreDataTableLayouts
object.
KMG01
Kaplan-Meier Plot 1.
Description
KMG01
Kaplan-Meier Plot 1.
Usage
kmg01_main(
adam_db,
dataset = "adtte",
arm_var = "ARM",
strata = NULL,
strat = lifecycle::deprecated(),
...
)
kmg01_pre(adam_db, dataset = "adtte", ...)
kmg01
Arguments
Format
An object of class chevron_g
of length 1.
Details
No overall value.
Value
the main function returns a gTree
object.
a gTree
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
kmg01_main()
: Main TLG Function -
kmg01_pre()
: Preprocessing
Note
-
adam_db
object must contain the table specified bydataset
with the columns specified byarm_var
.
Examples
library(dplyr)
library(dunlin)
col <- c(
"A: Drug X" = "black",
"B: Placebo" = "blue",
"C: Combination" = "gray"
)
pre_data <- log_filter(syn_data, PARAMCD == "OS", "adtte")
run(kmg01, pre_data, dataset = "adtte", col = col)
LBT01
Lab Results and Change from Baseline by Visit Table.
Description
The LBT01
table provides an
overview of the Lab values and its change from baseline of each respective arm
over the course of the trial.
Usage
lbt01_main(
adam_db,
dataset = "adlb",
arm_var = "ACTARM",
lbl_overall = NULL,
row_split_var = NULL,
summaryvars = c("AVAL", "CHG"),
visitvar = "AVISIT",
precision = lab_paramcd_precision(),
page_var = "PARAMCD",
.stats = c("n", "mean_sd", "median", "range"),
skip = list(CHG = "BASELINE"),
...
)
lbt01_pre(adam_db, dataset = "adlb", ...)
lbt01
lab_paramcd_precision()
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
summaryvars |
( |
visitvar |
( |
precision |
(named |
page_var |
( |
.stats |
( |
skip |
Named ( |
... |
additional arguments like |
Format
An object of class chevron_t
of length 1.
Details
The
Analysis Value
column, displays the number of patients, the mean, standard deviation, median and range of the analysis value for each visit.The
Change from Baseline
column, displays the number of patient and the mean, standard deviation, median and range of changes relative to the baseline.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Sorted based on factor level; first by
PARAM
labels in alphabetic order then by chronological time point given byAVISIT
. Re-level to customize order
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
a named list
with the precision of each lab parameter code (default is 2
).
Functions
-
lbt01_main()
: Main TLG function -
lbt01_pre()
: Preprocessing -
lab_paramcd_precision()
:
Note
-
adam_db
object must contain table named asdataset
with the columns specified insummaryvars
.
Examples
run(lbt01, syn_data)
# example code
head(lab_paramcd_precision())
lbt04
Layout
Description
lbt04
Layout
Usage
lbt04_lyt(
arm_var,
lbl_overall,
lbl_param,
lbl_abn_var,
var_parcat,
var_param,
row_split_var,
row_split_lbl,
analysis_abn_var,
variables,
page_var
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_param |
( |
lbl_abn_var |
( |
row_split_var |
( |
variables |
( |
page_var |
( |
LBT04
Laboratory Abnormalities Not Present at Baseline Table.
Description
The LBT04
table provides an
overview of laboratory abnormalities not present at baseline.
Usage
lbt04_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
analysis_abn_var = "ANRIND",
baseline_abn_var = "BNRIND",
row_split_var = "PARCAT1",
page_var = tail(row_split_var, 1L),
...
)
lbt04_pre(adam_db, ...)
lbt04_post(tlg, ...)
lbt04
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
analysis_abn_var |
( |
baseline_abn_var |
( |
row_split_var |
( |
page_var |
( |
... |
not used. |
tlg |
( |
Format
An object of class chevron_t
of length 1.
Details
Only count LOW or HIGH values.
Lab test results with missing
analysis_abn_var
values are excluded.Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
lbt04_main()
: Main TLG function -
lbt04_pre()
: Preprocessing -
lbt04_post()
: Postprocessing
Note
-
adam_db
object must contain anadlb
table with columns"PARCAT1"
,"PARCAT2"
,"PARAM"
,"ANRIND"
, and column specified byarm_var
.
Examples
run(lbt04, syn_data)
lbt05
Layout
Description
lbt05
Layout
Usage
lbt05_lyt(arm_var, lbl_overall, lbl_param, lbl_anrind, map)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_param |
( |
lbl_anrind |
( |
map |
( |
LBT05
Table 1 (Default) Laboratory Abnormalities with Single and Replicated Marked.
Description
LBT05
Table 1 (Default) Laboratory Abnormalities with Single and Replicated Marked.
Usage
lbt05_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
map = lab_paramcd_abn_dir(),
...
)
lbt05_pre(adam_db, ...)
lbt05_post(tlg, prune_0 = FALSE, keep = "Any Abnormality", ...)
lbt05
lab_paramcd_abn_dir()
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
map |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
keep |
( |
Format
An object of class chevron_t
of length 1.
Details
Does not remove rows with zero counts by default.
Lab test results with missing
AVAL
values are excluded.Split columns by arm, typically
ACTARM
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
a data.frame
with the direction of abnormality of each lab parameter code.
Functions
-
lbt05_main()
: Main TLG function -
lbt05_pre()
: Preprocessing -
lbt05_post()
: Postprocessing -
lab_paramcd_abn_dir()
:
Note
-
adam_db
object must contain anadlb
table with columns"ONTRTFL"
,"PARCAT2"
,"PARAM"
,"ANRIND"
,"AVALCAT1"
, and column specified byarm_var
.
Examples
run(lbt05, syn_data)
map <- data.frame(PARAMCD = c("ALT", "ALT", "CRP", "CRP", "IGA", "XXX"), ABN_DIR = c("Low", "High"))
run(lbt05, syn_data, map = map)
# example code
head(lab_paramcd_abn_dir())
lbt06
Layout
Description
lbt06
Layout
Usage
lbt06_lyt(
arm_var,
lbl_overall,
lbl_param,
lbl_visit,
lbl_anrind,
lbl_bnrind,
visitvar,
anrind_var,
bnrind_var,
page_var
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_param |
( |
lbl_visit |
( |
lbl_anrind |
( |
lbl_bnrind |
( |
visitvar |
( |
anrind_var |
( |
bnrind_var |
( |
page_var |
( |
LBT06
Table 1 (Default) Laboratory Abnormalities by Visit and Baseline Status Table 1.
Description
The LBT06
table produces the standard laboratory abnormalities by visit and
baseline status summary.
Usage
lbt06_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
page_var = "PARAMCD",
...
)
lbt06_pre(adam_db, ...)
lbt06_post(tlg, prune_0 = FALSE, ...)
lbt06
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
page_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Only count
"LOW"
or"HIGH"
values forANRIND
andBNRIND
.Lab test results with missing
ANRIND
values are excluded.Split columns by arm, typically
ACTARM
.Keep zero count rows by default.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
lbt06_main()
: Main TLG function -
lbt06_pre()
: Preprocessing -
lbt06_post()
: Postprocessing
Note
-
adam_db
object must contain anadlb
table with columns"AVISIT"
,"ANRIND"
,"BNRIND"
,"ONTRTFL"
, and"PARCAT2"
, and column specified byarm_var
.
Examples
run(lbt06, syn_data)
lbt07
Layout
Description
lbt07
Layout
Usage
lbt07_lyt(
arm_var,
lbl_overall,
lbl_param_var,
lbl_grad_dir_var,
param_var,
grad_dir_var,
grad_anl_var,
map
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_param_var |
( |
lbl_grad_dir_var |
( |
param_var |
( |
grad_dir_var |
( |
grad_anl_var |
( |
map |
( |
LBT07
Table 1 (Default) Laboratory Test Results and Change from Baseline by Visit.
Description
The LBT07
table provides an
overview of the analysis values and its change from baseline of each respective arm over the course of the trial.
Usage
lbt07_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
param_var = "PARAM",
grad_dir_var = "GRADE_DIR",
grad_anl_var = "GRADE_ANL",
...
)
lbt07_pre(adam_db, ...)
lbt07_post(tlg, prune_0 = TRUE, keep = "Any", ...)
lbt07
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
param_var |
( |
grad_dir_var |
( |
grad_anl_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
keep |
( |
Format
An object of class chevron_t
of length 1.
Details
Split columns by arm, typically
ACTARM
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
lbt07_main()
: Main TLG function -
lbt07_pre()
: Preprocessing -
lbt07_post()
: Postprocessing
Note
-
adam_db
object must contain anadlb
table with columns"USUBJID"
,"ATOXGR"
,"ONTRTFL"
and column specified byarm_var
.
Examples
run(lbt07, syn_data)
lbt14
Layout
Description
lbt14
Layout
Usage
lbt14_lyt(arm_var, lbl_overall, lbl_param, lbl_btoxgr, page_var)
Arguments
arm_var |
( |
lbl_overall |
( |
page_var |
( |
LBT14
Laboratory Test Results Shift Table – Highest NCI-CTCAE
Grade Post-Baseline by
Baseline Grade (Low or High Direction).
Description
LBT14
Laboratory Test Results Shift Table – Highest NCI-CTCAE
Grade Post-Baseline by
Baseline Grade (Low or High Direction).
Usage
lbt14_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
gr_missing = "incl",
page_var = "PARAMCD",
...
)
lbt14_pre(adam_db, gr_missing = "incl", direction = "low", ...)
lbt14_post(tlg, prune_0 = TRUE, ...)
lbt14
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
gr_missing |
( |
page_var |
( |
... |
not used. |
direction |
( |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
This table follows ADaMIG v1.1.
Only the worst grade recorded for each patient is included in the table.
If no missing baseline lab results, the "Missing" level of
BTOXGR
is excluded.Grading takes value from -4 to 4, negative value means the abnormality direction is low, positive value means the abnormality direction is high.
Grades 0, 1, 2, 3, and 4 are counted as
"Not Low"
whendirection = "low"
. Conversely, whendirection = "high"
, Grades 0, -1, -2, -3, and -4 are counted as '"Not High".Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm, typically
ACTARM
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
lbt14_main()
: Main TLG function -
lbt14_pre()
: Preprocessing -
lbt14_post()
: Postprocessing
Note
-
adam_db
object must contain anadlb
table with columns"USUBJID"
,"PARAM"
,"BTOXGR"
,"ATOXGR"
, and the column specified byarm_var
.
Examples
run(lbt14, syn_data)
LBT15
Laboratory Test Shifts to NCI-CTCAE
Grade 3-4 Post-Baseline Table.
Description
LBT15
Laboratory Test Shifts to NCI-CTCAE
Grade 3-4 Post-Baseline Table.
Usage
lbt15_pre(adam_db, ...)
lbt15
Arguments
adam_db |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Value
the preprocessing function returns a list
of data.frame
.
Functions
-
lbt15_pre()
: Preprocessing
Source
lbt04.R
Examples
run(lbt15, syn_data)
Format for Chevron Listings
Description
Format for Chevron Listings
Usage
listing_format_chevron()
Value
a list
of fmt_config
.
Obtain levels from vector
Description
Obtain levels from vector
Usage
lvls(x)
Arguments
x |
( |
Details
For factors, the levels will be returned. For characters, the sorted unique values will be returned.
Value
character
with unique values.
Main
Description
retrieve or set main
function.
Usage
main(x)
## S4 method for signature 'chevron_tlg'
main(x)
main(x) <- value
## S4 replacement method for signature 'chevron_tlg'
main(x) <- value
Arguments
x |
( |
value |
( |
Value
the function
stored in the main
slot of the x
argument.
MHT01
Medical History Table.
Description
The MHT01
table provides an overview of the subjects medical
history by SOC and Preferred Term.
Usage
mht01_label
mht01_main(
adam_db,
arm_var = "ARM",
row_split_var = "MHBODSYS",
lbl_overall = NULL,
summary_labels = list(all = mht01_label),
...
)
mht01_pre(adam_db, ...)
mht01_post(tlg, row_split_var = "MHBODSYS", prune_0 = TRUE, ...)
mht01
Arguments
adam_db |
( |
arm_var |
( |
row_split_var |
( |
lbl_overall |
( |
summary_labels |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class character
of length 2.
An object of class chevron_t
of length 1.
Details
Numbers represent absolute numbers of patients and fraction of
N
, or absolute number of event when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Order by
row_split_var
alphabetically and medical condition by decreasing total number of patients with the specific condition.summary_labels
is used to control the summary for each level. If "all" is used, then each split will have that summary statistic with the labels. One special case is "TOTAL", this is for the overall population.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
mht01_label
: Default labels -
mht01_main()
: Main TLG function -
mht01_pre()
: Preprocessing -
mht01_post()
: Postprocessing
Note
-
adam_db
object must contain anadmh
table with columns"MHBODSYS"
and"MHDECOD"
.
Examples
run(mht01, syn_data)
Missing rule
Description
Missing rule
Usage
missing_rule
Format
An object of class rule
(inherits from character
) of length 2.
MLA Grade Direction Data
Description
MLA Grade Direction Data
Usage
mla_dir
Format
An object of class data.frame
with 76 rows and 2 columns.
MNG01
Mean Plot Graph.
Description
Overview of a summary statistics across time and arm for a selected data set.
Usage
mng01_main(
adam_db,
dataset = "adlb",
x_var = "AVISIT",
y_var = "AVAL",
y_name = "PARAM",
y_unit = NULL,
arm_var = "ACTARM",
center_fun = "mean",
interval_fun = "mean_ci",
jitter = 0.3,
line_col = nestcolor::color_palette(),
line_type = NULL,
ggtheme = gg_theme_chevron(),
table = c("n", center_fun, interval_fun),
...
)
mng01_pre(adam_db, dataset, x_var = "AVISIT", ...)
mng01
Arguments
adam_db |
( |
dataset |
( |
x_var |
( |
y_var |
( |
y_name |
( |
y_unit |
( |
arm_var |
( |
center_fun |
( |
interval_fun |
( |
jitter |
( |
line_col |
( |
line_type |
( |
ggtheme |
( |
table |
( |
... |
passed to |
Format
An object of class chevron_g
of length 1.
Details
No overall value.
Preprocessing filters for
ANL01FL
in the selected data set.
Value
the main function returns a list
of ggplot
objects.
a list of ggplot
objects.
the preprocessing function returns a list
of data.frame
.
Functions
-
mng01_main()
: Main TLG Function -
mng01_pre()
: Preprocessing
Note
-
adam_db
object must contain the table specified bydataset
with the columns specified byx_var
,y_var
,y_name
,y_unit
andarm_var
.
See Also
gg_theme_chevron()
, tern::g_lineplot()
.
Examples
col <- c(
"A: Drug X" = "black",
"B: Placebo" = "blue",
"C: Combination" = "gray"
)
lt <- c(
"A: Drug X" = "29",
"B: Placebo" = "99",
"C: Combination" = "solid"
)
run(
mng01,
syn_data,
dataset = "adlb",
x_var = c("AVISIT", "AVISITN"),
line_col = col,
line_type = lt
)
Modify character
Description
Modify character
Usage
modify_character(x, y)
No Coding Available rule
Description
No Coding Available rule
Usage
nocoding
Format
An object of class rule
(inherits from character
) of length 2.
Obtain value from a vector
Description
Obtain value from a vector
Usage
obtain_value(obj, index)
Occurrence Layout
Description
Occurrence Layout
Usage
occurrence_lyt(
arm_var,
lbl_overall,
row_split_var,
lbl_row_split,
medname_var,
lbl_medname_var,
summary_labels,
count_by
)
Arguments
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
medname_var |
( |
lbl_medname_var |
( |
summary_labels |
( |
Outcome Rule
Description
Outcome Rule
Usage
outcome_rule
Format
An object of class rule
(inherits from character
) of length 6.
pdt01
Layout
Description
pdt01
Layout
Usage
pdt01_lyt(
arm_var,
lbl_overall,
dvcode_var,
lbl_dvcode_var,
dvterm_var,
lbl_dvterm_var
)
Arguments
arm_var |
( |
lbl_overall |
( |
dvcode_var |
( |
lbl_dvcode_var |
( |
dvterm_var |
( |
lbl_dvterm_var |
( |
pdt01
Major Protocol Deviations Table.
Description
A major protocol deviations table with the number of subjects and the total number of treatments by medication class sorted alphabetically and medication name sorted by frequencies.
Usage
pdt01_main(
adam_db,
arm_var = "ARM",
lbl_overall = NULL,
dvcode_var = "DVDECOD",
dvterm_var = "DVTERM",
...
)
pdt01_pre(adam_db, ...)
pdt01_post(
tlg,
prune_0 = TRUE,
dvcode_var = "DVDECOD",
dvterm_var = "DVTERM",
...
)
pdt01
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
dvcode_var |
( |
dvterm_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Data should be filtered for major protocol deviations.
(DVCAT == "MAJOR")
.Numbers represent absolute numbers of subjects and fraction of
N
, or absolute numbers when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort by medication class alphabetically and within medication class by decreasing total number of patients with the specific medication.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
pdt01_main()
: Main TLG function -
pdt01_pre()
: Preprocessing -
pdt01_post()
: Postprocessing
Note
-
adam_db
object must contain anaddv
table with the columns specified indvcode_var
anddvterm_var
as well as"DVSEQ"
.
Examples
run(pdt01, syn_data)
pdt02
Layout
Description
pdt02
Layout
Usage
pdt02_lyt(
arm_var,
lbl_overall,
lbl_dvreas_var,
lbl_dvterm_var,
dvreas_var,
dvterm_var
)
Arguments
arm_var |
( |
lbl_overall |
( |
lbl_dvreas_var |
( |
lbl_dvterm_var |
( |
dvreas_var |
( |
dvterm_var |
( |
pdt02
Major Protocol Deviations Related to Epidemic/Pandemic Table.
Description
A major protocol deviations table with the number of subjects and the total number of Major Protocol Deviations Related to Epidemic/Pandemic sorted alphabetically and deviations name sorted by frequencies.
Usage
pdt02_main(
adam_db,
arm_var = "ARM",
lbl_overall = NULL,
dvreas_var = "DVREAS",
dvterm_var = "DVTERM",
...
)
pdt02_pre(adam_db, ...)
pdt02_post(
tlg,
prune_0 = TRUE,
dvreas_var = "DVREAS",
dvterm_var = "DVTERM",
...
)
pdt02
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
dvreas_var |
( |
dvterm_var |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Data should be filtered for major protocol deviations related to epidemic/pandemic.
(AEPRELFL == "Y" & DVCAT == "MAJOR")
.Numbers represent absolute numbers of subjects and fraction of
N
, or absolute numbers when specified.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm.
Does not include a total column by default.
Sort by deviation reason alphabetically and within deviation reason by decreasing total number of patients with the specific deviation term.
Value
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
pdt02_main()
: Main TLG function -
pdt02_pre()
: Preprocessing -
pdt02_post()
: Postprocessing
Note
-
adam_db
object must contain anaddv
table with the columns specified indvreas_var
anddvterm_var
.
Examples
run(pdt02, syn_data)
Post process
Description
retrieve or set postprocess
function.
Usage
postprocess(x)
## S4 method for signature 'chevron_tlg'
postprocess(x)
postprocess(x) <- value
## S4 replacement method for signature 'chevron_tlg'
postprocess(x) <- value
Arguments
x |
( |
value |
( |
Value
the function
stored in the postprocess
slot of the x
argument.
Pre process
Description
retrieve or set preprocess
function.
Usage
preprocess(x)
## S4 method for signature 'chevron_tlg'
preprocess(x)
preprocess(x) <- value
## S4 replacement method for signature 'chevron_tlg'
preprocess(x) <- value
Arguments
x |
( |
value |
( |
Value
the function
stored in the preprocess
slot of the x
argument.
Print Arguments
Description
Print Arguments
Usage
print_args(run_call, additional_args, args, auto_pre = TRUE)
Print list
Description
Print list
Usage
print_list(x, indent = 2L)
Proportion layout
Description
Proportion layout
Usage
proportion_lyt(
lyt,
arm_var,
methods,
strata,
conf_level,
odds_ratio = TRUE,
rsp_var = "IS_RSP"
)
Arguments
lyt |
layout created by |
arm_var |
( |
methods |
( |
strata |
( |
conf_level |
( |
odds_ratio |
( |
Prune table except specified levels
Description
Prune table except specified levels
Usage
prune_except(keep)
Arguments
keep |
( |
Value
A pruning function
.
Objects exported from other packages
Description
These objects are imported from other packages. Follow the links below to see their documentation.
- dunlin
- formatters
Creates NULL
Report
Description
Creates NULL
Report
Usage
report_null(tlg, ...)
## S4 method for signature 'NULL'
report_null(tlg, ind = 2L, ...)
## S4 method for signature 'VTableTree'
report_null(tlg, ind = 2L, ...)
## S4 method for signature 'listing_df'
report_null(tlg, ind = 2L, ...)
## S4 method for signature 'list'
report_null(tlg, ind = 2L, ...)
## S4 method for signature 'ANY'
report_null(tlg, ...)
standard_null_report()
Arguments
tlg |
to convert to null report. |
... |
not used. |
ind |
( |
Value
the tlg
object or a NULL
report if the tlg
is NULL
, is a TableTree
with 0 rows, is a listing_df
with 0 rows or is a list
with 0 elements.
Examples
report_null(NULL)
rmpt01
Layout
Description
rmpt01
Layout
Usage
rmpt01_lyt(
summaryvars,
lbl_summaryvars,
show_tot,
row_split_var,
col_split_var,
overall_col_lbl
)
Arguments
summaryvars |
( |
lbl_summaryvars |
( |
show_tot |
( |
row_split_var |
( |
col_split_var |
( |
overall_col_lbl |
( |
RMPT01
Duration of Exposure for Risk Management Plan Table.
Description
The RMPT01
table provides an overview of duration of exposure.
Usage
rmpt01_main(
adam_db,
summaryvars = "AVALCAT1",
show_tot = TRUE,
row_split_var = NULL,
col_split_var = NULL,
overall_col_lbl = NULL,
...
)
rmpt01_pre(adam_db, summaryvars = "AVALCAT1", ...)
rmpt01_post(tlg, prune_0 = FALSE, ...)
rmpt01
Arguments
adam_db |
( |
summaryvars |
( |
show_tot |
( |
row_split_var |
( |
col_split_var |
( |
overall_col_lbl |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Person time is the sum of exposure across all patients.
Summary statistics are by default based on the number of patients in the corresponding
N
row (number of non-missing values).Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
rmpt01_main()
: Main TLG function -
rmpt01_pre()
: Preprocessing -
rmpt01_post()
: Postprocessing
Note
-
adam_db
object must contain anadex
table with"AVAL"
and the columns specified bysummaryvars
.
Examples
run(rmpt01, syn_data, col_split_var = "SEX")
rmpt03
Duration of Exposure for Risk Management Plan Table.
Description
The rmpt03
table provides an overview of duration of exposure.
Usage
rmpt03_main(
adam_db,
summaryvars = "AGEGR1",
show_tot = TRUE,
row_split_var = NULL,
col_split_var = "SEX",
overall_col_lbl = "All Genders",
...
)
rmpt03_pre(adam_db, summaryvars = "AGEGR1", ...)
rmpt03
Arguments
adam_db |
( |
summaryvars |
( |
show_tot |
( |
row_split_var |
( |
col_split_var |
( |
overall_col_lbl |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Details
Person time is the sum of exposure across all patients.
Summary statistics are by default based on the number of patients in the corresponding
N
row (number of non-missing values).Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
rmpt03_main()
: Main TLG function -
rmpt03_pre()
: Preprocessing
Examples
pre_data <- dunlin::propagate(syn_data, "adsl", "AGEGR1", "USUBJID")
run(rmpt03, pre_data)
RMPT04
Extent of Exposure by Ethnic Origin for Risk Management Plan Table.
Description
The RMPT04
table provides an overview of duration of exposure extent.
Usage
rmpt04_main(
adam_db,
summaryvars = "ETHNIC",
show_tot = TRUE,
row_split_var = NULL,
col_split_var = NULL,
overall_col_lbl = NULL,
...
)
rmpt04_pre(adam_db, summaryvars = "ETHNIC", ...)
rmpt04
Arguments
adam_db |
( |
summaryvars |
( |
show_tot |
( |
row_split_var |
( |
col_split_var |
( |
overall_col_lbl |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Details
Person time is the sum of exposure across all patients.
Summary statistics are by default based on the number of patients in the corresponding
N
row (number of non-missing values).Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
rmpt04_main()
: Main TLG function -
rmpt04_pre()
: Preprocessing
Examples
run(rmpt04, syn_data)
RMPT05
Extent of Exposure by Race for Risk Management Plan Table.
Description
The RMPT05
table provides an overview of duration of exposure extent.
Usage
rmpt05_main(
adam_db,
summaryvars = "RACE",
show_tot = TRUE,
row_split_var = NULL,
col_split_var = NULL,
overall_col_lbl = NULL,
...
)
rmpt05_pre(adam_db, summaryvars = "RACE", ...)
rmpt05
Arguments
adam_db |
( |
summaryvars |
( |
show_tot |
( |
row_split_var |
( |
col_split_var |
( |
overall_col_lbl |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Details
Person time is the sum of exposure across all patients.
Summary statistics are by default based on the number of patients in the corresponding
N
row (number of non-missing values).Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
rmpt05_main()
: Main TLG function -
rmpt05_pre()
: Preprocessing
Examples
run(rmpt05, syn_data)
rmpt06
Layout
Description
rmpt06
Layout
Usage
rmpt06_lyt(
arm_var,
lbl_overall,
method,
conf_level,
show_diff,
ref_group,
method_diff,
conf_level_diff,
grade_groups
)
Arguments
arm_var |
( |
lbl_overall |
( |
RMPT06
Table 1 (Default) Seriousness, Outcomes, Severity, Frequency with 95% CI for Risk Management Plan.
Description
RMPT06
Table 1 (Default) Seriousness, Outcomes, Severity, Frequency with 95% CI for Risk Management Plan.
Usage
rmpt06_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
method = "clopper-pearson",
conf_level = 0.95,
show_diff = FALSE,
ref_group = NULL,
method_diff = "wald",
conf_level_diff = 0.95,
grade_groups = NULL,
...
)
rmpt06_pre(adam_db, ...)
rmpt06_post(tlg, prune_0 = FALSE, ...)
rmpt06
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
method |
( |
conf_level |
( |
show_diff |
( |
ref_group |
( |
method_diff |
( |
conf_level_diff |
( |
grade_groups |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
rmpt06_main()
: Main TLG function -
rmpt06_pre()
: Preprocessing -
rmpt06_post()
: Postprocessing
Examples
run(rmpt06, syn_data)
rspt01
Layout
Description
rspt01
Layout
Usage
rspt01_lyt(
arm_var,
rsp_var,
ref_group,
odds_ratio,
perform_analysis,
strata,
conf_level,
methods
)
Arguments
arm_var |
( |
RSPT01
Binary Outcomes Summary.
Description
RSPT01
template may be used to summarize any binary outcome or response variable at
a single time point. Typical application for oncology
Usage
rspt01_main(
adam_db,
dataset = "adrs",
arm_var = "ARM",
ref_group = NULL,
odds_ratio = TRUE,
perform_analysis = "unstrat",
strata = NULL,
conf_level = 0.95,
methods = list(),
...
)
rspt01_pre(adam_db, ...)
rspt01_post(tlg, prune_0 = TRUE, ...)
rspt01
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
ref_group |
( |
odds_ratio |
( |
perform_analysis |
( |
strata |
( |
conf_level |
( |
methods |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
No overall value.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
rspt01_main()
: Main TLG function -
rspt01_pre()
: Preprocessing -
rspt01_post()
: Postprocessing
Examples
library(dplyr)
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "BESRSPI", "adrs")
run(rspt01, proc_data)
run(rspt01, proc_data,
odds_ratio = FALSE, perform_analysis = c("unstrat", "strat"),
strata = c("STRATA1", "STRATA2"), methods = list(diff_pval_method = "fisher")
)
Run the TLG-generating pipeline
Description
Run the TLG-generating pipeline
Usage
run(
object,
adam_db,
auto_pre = TRUE,
verbose = FALSE,
unwrap = FALSE,
...,
user_args = list(...)
)
## S4 method for signature 'chevron_tlg'
run(
object,
adam_db,
auto_pre = TRUE,
verbose = get_arg("chevron.run.verbose", "R_CHEVRON_RUN_VERBOSE", FALSE),
unwrap = get_arg("chevron.run.unwrap", "R_CHEVRON_RUN_UNWRAP", verbose),
...,
user_args = list(...)
)
Arguments
object |
( |
adam_db |
( |
auto_pre |
( |
verbose |
( |
unwrap |
( |
... |
extra arguments to pass to the pre-processing, main and post-processing functions. |
user_args |
( |
Details
The functions stored in the preprocess
, main
and postprocess
slots of the chevron_tlg
objects are called
respectively, preprocessing
, main
and postprocessing
functions.
When executing the run
method on a chevron_tlg
object, if auto_pre
is TRUE
, the adam_bd
list is first
passed to the preprocessing
function. The resulting list is then passed to the main
function which produces a
table, graph or listings or a list of these objects. This output is then passed to the postprocessing
function
which performed the final modifications before returning the output. Additional arguments specified in ...
or
user_args
are passed to each of the three functions.
Value
an rtables
(for chevron_t
), rlistings
(for chevron_l
), grob
(for chevron_g
) or ElementaryTable
(null report) depending on the class of chevron_tlg
object passed as object
argument.
Examples
run(mng01, syn_data, auto_pre = TRUE, dataset = "adlb")
Summary factor allowing NA
Description
Summary factor allowing NA
Usage
s_summary_na(
x,
labelstr,
denom = c("n", "N_row", "N_col"),
.N_row,
.N_col,
...
)
Arguments
x |
( |
denom |
( |
.N_row |
( |
.N_col |
( |
... |
Not used |
Create Script for TLG
Generation
Description
Create Script for TLG
Generation
Usage
script_funs(x, adam_db, args, name = deparse(substitute(x)))
## S4 method for signature 'chevron_tlg'
script_funs(x, adam_db, args, name = deparse(substitute(x)))
## S4 method for signature 'chevron_simple'
script_funs(x, adam_db, args, name = deparse(substitute(x)))
Arguments
x |
( |
adam_db |
( |
args |
( |
name |
( |
Value
character
that can be integrated into an executable script.
Examples
script_funs(aet04, adam_db = "syn_data", args = "args")
Set Section Dividers
Description
Set Section Dividers
Usage
set_section_div(x)
Arguments
x |
( |
Details
Section dividers are empty lines between sections in tables.
E.g. if 1 is used then for the first row split an empty line is added.
Currently it only works for aet02
, cmt01a
and mht01
template.
Value
invisible NULL
. Set the chevron.section_div
option.
Prune table up to an ElementaryTable
Description
Avoid returning NULL
when the table
is empty.
Usage
smart_prune(tlg)
Arguments
tlg |
( |
Value
pruned TableTree
.
Count or summarize by groups
Description
Count or summarize by groups
Usage
split_rows_by_recursive(lyt, row_split_var, ...)
Arguments
lyt |
( |
row_split_var |
( |
... |
Further arguments for |
Standard Main Listing Function
Description
Standard Main Listing Function
Usage
std_listing(
adam_db,
dataset,
key_cols,
disp_cols,
split_into_pages_by_var,
unique_rows = FALSE,
...
)
Arguments
adam_db |
( |
dataset |
( |
key_cols |
( |
disp_cols |
( |
split_into_pages_by_var |
( |
unique_rows |
( |
... |
additional arguments passed to |
Value
the main function returns an rlistings
or a list
object.
Standard Post Processing
Description
Standard Post Processing
Usage
std_postprocessing(tlg, ...)
Arguments
tlg |
to post process. |
... |
additional arguments passed to report_null. |
Value
a processed tlg
or a null report.
Examples
library(rtables)
std_postprocessing(build_table(basic_table() |> analyze("Species"), iris), ind = 10L)
Summarize variables allow NA
Description
Summarize variables allow NA
Usage
summarize_vars_allow_na(
lyt,
vars,
var_labels = vars,
nested = TRUE,
...,
show_labels = "default",
table_names = vars,
section_div = NA_character_,
.stats = c("n", "count_fraction"),
.formats = list(count_fraction = format_count_fraction_fixed_dp),
.labels = NULL,
.indent_mods = NULL,
inclNAs = TRUE
)
Example adam
Synthetic Data
Description
Example adam
Synthetic Data
Usage
syn_data
Format
A named list
of 13 data.frames
:
- adsl
- adae
- adsaftte
- adcm
- addv
- adeg
- adex
- adlb
- admh
- adrs
- adsub
- adtte
- advs
Source
based on package random.cdisc.data
ttet01
Layout
Description
ttet01
Layout
Usage
ttet01_lyt(
arm_var,
ref_group,
summarize_event,
perform_analysis,
strata,
timeunit,
event_lvls,
control_survt,
control_cox_ph,
control_survtp,
...
)
Arguments
arm_var |
( |
timeunit |
( |
... |
not used. |
TTET01
Binary Outcomes Summary.
Description
TTET01
template may be used to summarize any binary outcome or response variable at
a single time point. Typical application for oncology
Usage
ttet01_main(
adam_db,
dataset = "adtte",
arm_var = "ARM",
ref_group = NULL,
summarize_event = TRUE,
perform_analysis = "unstrat",
strata = NULL,
...
)
ttet01_pre(adam_db, dataset = "adtte", ...)
ttet01_post(tlg, prune_0 = TRUE, ...)
ttet01
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
ref_group |
( |
summarize_event |
( |
perform_analysis |
( |
strata |
( |
... |
Further arguments passed to |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
No overall value.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
ttet01_main()
: Main TLG function -
ttet01_pre()
: Preprocessing -
ttet01_post()
: Postprocessing
Examples
library(dplyr)
library(dunlin)
proc_data <- log_filter(syn_data, PARAMCD == "PFS", "adtte")
run(ttet01, proc_data)
run(ttet01, proc_data,
summarize_event = FALSE, perform_analysis = c("unstrat", "strat"),
strata = c("STRATA1", "STRATA2"),
conf_type = "log-log",
time_point = c(6, 12),
method = "both"
)
Extracting Layout Function.
Description
Extracting Layout Function.
Usage
unwrap_layout(x, pattern = "_lyt$")
Arguments
x |
( |
pattern |
( |
Value
invisible NULL
and print the content of the layout functions found in the body of x
.
Examples
unwrap_layout(aet01_main)
Retrieve labels for certain variables
Description
Retrieve labels for certain variables
Usage
var_labels_for(df, vars)
Arguments
df |
( |
vars |
( |
Details
The labels will be returned if the column has label
attribute, otherwise the column name will be returned.
Any values between brackets will be replaced with dunlin::render_safe
.
Value
a character
with replaced placeholders and a label
attribute.
VST01
Vital Sign Results and change from Baseline By Visit Table.
Description
The VST01
table provides an
overview of the Vital Sign values and its change from baseline of each respective arm
over the course of the trial.
Usage
vst01_main(
adam_db,
dataset = "advs",
arm_var = "ACTARM",
lbl_overall = NULL,
row_split_var = NULL,
summaryvars = c("AVAL", "CHG"),
visitvar = "AVISIT",
precision = list(DIABP = 0, PUL = 0, SYSBP = 0, default = 2L),
page_var = "PARAMCD",
.stats = c("n", "mean_sd", "median", "range"),
skip = list(CHG = "BASELINE"),
...
)
vst01_pre(adam_db, dataset = "advs", ...)
vst01
Arguments
adam_db |
( |
dataset |
( |
arm_var |
( |
lbl_overall |
( |
row_split_var |
( |
summaryvars |
( |
visitvar |
( |
precision |
(named |
page_var |
( |
.stats |
( |
skip |
Named ( |
... |
additional arguments like |
Format
An object of class chevron_t
of length 1.
Details
The
Analysis Value
column, displays the number of patients, the mean, standard deviation, median and range of the analysis value for each visit.The
Change from Baseline
column, displays the number of patient and the mean, standard deviation, median and range of changes relative to the baseline.Remove zero-count rows unless overridden with
prune_0 = FALSE
.Split columns by arm, typically
ACTARM
.Does not include a total column by default.
Sorted based on factor level; first by
PARAM
labels in alphabetic order then by chronological time point given byAVISIT
. Re-level to customize order
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
Functions
-
vst01_main()
: Main TLG function -
vst01_pre()
: Preprocessing
Note
-
adam_db
object must contain table named asdataset
with the columns specified insummaryvars
.
Examples
library(dunlin)
proc_data <- log_filter(
syn_data,
PARAMCD %in% c("DIABP", "SYSBP"), "advs"
)
run(vst01, proc_data)
VST02
Vital Sign Abnormalities Table.
Description
Vital Sign Parameters outside Normal Limits Regardless of Abnormality at Baseline.
Usage
vst02_1_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
exclude_base_abn = FALSE,
...
)
vst02_pre(adam_db, ...)
vst02_post(tlg, prune_0 = FALSE, ...)
vst02_1
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
exclude_base_abn |
( |
... |
not used. |
tlg |
( |
prune_0 |
( |
Format
An object of class chevron_t
of length 1.
Details
Only count LOW or HIGH values.
Results of "LOW LOW" are treated as the same as "LOW", and "HIGH HIGH" the same as "HIGH".
Does not include a total column by default.
Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
vst02_1_main()
: Main TLG function -
vst02_pre()
: Preprocessing -
vst02_post()
: Postprocessing
Note
-
adam_db
object must contain anadvs
table with the"PARAM"
,"ANRIND"
and"BNRIND"
columns.
Examples
run(vst02_1, syn_data)
VST02
Vital Sign Abnormalities Table.
Description
Vital Sign Parameters outside Normal Limits Among Patients without Abnormality at Baseline.
Usage
vst02_2_main(
adam_db,
arm_var = "ACTARM",
lbl_overall = NULL,
exclude_base_abn = TRUE,
...
)
vst02_2
Arguments
adam_db |
( |
arm_var |
( |
lbl_overall |
( |
exclude_base_abn |
( |
... |
not used. |
Format
An object of class chevron_t
of length 1.
Details
Only count LOW or HIGH values.
Results of "LOW LOW" are treated as the same as "LOW", and "HIGH HIGH" the same as "HIGH".
Does not include a total column by default.
Does not remove zero-count rows unless overridden with
prune_0 = TRUE
.
Value
the main function returns an rtables
object.
the preprocessing function returns a list
of data.frame
.
the postprocessing function returns an rtables
object or an ElementaryTable
(null report).
Functions
-
vst02_2_main()
: Main TLG function
Note
-
adam_db
object must contain anadvs
table with the"PARAM"
,"ANRIND"
and"BNRIND"
columns.
Examples
run(vst02_2, syn_data)
vst02_1
Layout
Description
vst02_1
Layout
Usage
vst02_lyt(
arm_var,
lbl_overall,
exclude_base_abn,
lbl_vs_assessment,
lbl_vs_abnormality
)
Arguments
arm_var |
( |
lbl_overall |
( |
exclude_base_abn |
( |
lbl_vs_assessment |
( |
lbl_vs_abnormality |
( |
Yes/No rule in title case
Description
Yes/No rule in title case
Usage
yes_no_rule
Format
An object of class rule
(inherits from character
) of length 8.