diff --git a/main/404.html b/main/404.html new file mode 100644 index 00000000..b21250d8 --- /dev/null +++ b/main/404.html @@ -0,0 +1,96 @@ + + +
+ + + + +🙏 Thank you for taking the time to contribute!
+Your input is deeply valued, whether an issue, a pull request, or even feedback, regardless of size, content or scope.
+ +Please refer the project documentation for a brief introduction. Please also see other articles within the project documentation for additional information.
+A Code of Conduct governs this project. Participants and contributors are expected to follow the rules outlined therein.
+All your contributions will be covered by this project’s license.
+We use GitHub to track issues, feature requests, and bugs. Before submitting a new issue, please check if the issue has already been reported. If the issue already exists, please upvote the existing issue 👍.
+For new feature requests, please elaborate on the context and the benefit the feature will have for users, developers, or other relevant personas.
+This repository uses the GitHub Flow model for collaboration. To submit a pull request:
+Create a branch
+Please see the branch naming convention below. If you don’t have write access to this repository, please fork it.
+Make changes
+Make sure your code
+Create a pull request (PR)
+In the pull request description, please link the relevant issue (if any), provide a detailed description of the change, and include any assumptions.
+Address review comments, if any
Post approval
+Merge your PR if you have write access. Otherwise, the reviewer will merge the PR on your behalf.
+Pat yourself on the back
+Congratulations! 🎉 You are now an official contributor to this project! We are grateful for your contribution.
+Suppose your changes are related to a current issue in the current project; please name your branch as follows: <issue_id>_<short_description>
. Please use underscore (_
) as a delimiter for word separation. For example, 420_fix_ui_bug
would be a suitable branch name if your change is resolving and UI-related bug reported in issue number 420
in the current project.
If your change affects multiple repositories, please name your branches as follows: <issue_id>_<issue_repo>_<short description>
. For example, 69_awesomeproject_fix_spelling_error
would reference issue 69
reported in project awesomeproject
and aims to resolve one or more spelling errors in multiple (likely related) repositories.
monorepo
and staged.dependencies
+Sometimes you might need to change upstream dependent package(s) to be able to submit a meaningful change. We are using staged.dependencies
functionality to simulate a monorepo
behavior. The dependency configuration is already specified in this project’s staged_dependencies.yaml
file. You need to name the feature branches appropriately. This is the only exception from the branch naming convention described above.
Please refer to the staged.dependencies package documentation for more details.
+This repository follows some unified processes and standards adopted by its maintainers to ensure software development is carried out consistently within teams and cohesively across other repositories.
+This repository follows the standard tidyverse
style guide and uses lintr
for lint checks. Customized lint configurations are available in this repository’s .lintr
file.
Lightweight is the right weight. This repository follows tinyverse recommedations of limiting dependencies to minimum.
+If the code is not compatible with all (!) historical versions of a given dependenct package, it is required to specify minimal version in the DESCRIPTION
file. In particular: if the development version requires (imports) the development version of another package - it is required to put abc (>= 1.2.3.9000)
.
We continuously test our packages against the newest R version along with the most recent dependencies from CRAN and BioConductor. We recommend that your working environment is also set up in the same way. You can find the details about the R version and packages used in the R CMD check
GitHub Action execution log - there is a step that prints out the R sessionInfo()
.
If you discover bugs on older R versions or with an older set of dependencies, please create the relevant bug reports.
+pre-commit
We highly recommend that you use the pre-commit
tool combined with R hooks for pre-commit
to execute some of the checks before committing and pushing your changes.
Pre-commit hooks are already available in this repository’s .pre-commit-config.yaml
file.
As mentioned previously, all contributions are deeply valued and appreciated. While all contribution data is available as part of the repository insights, to recognize a significant contribution and hence add the contributor to the package authors list, the following rules are enforced:
+git blame
query) OR*Excluding auto-generated code, including but not limited to roxygen
comments or renv.lock
files.
The package maintainer also reserves the right to adjust the criteria to recognize contributions.
+Copyright 2022 F. Hoffmann-La Roche AG + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. ++ +
autoslider.core-package.Rd
Slides automation with R.
+Useful links:
autoslider_format.Rd
Zebra themed color
+autoslider_format(
+ ft,
+ odd_header = "#0EAED5",
+ odd_body = "#EBF5FA",
+ even_header = "#0EAED5",
+ even_body = "#D0E4F2",
+ font_name = "arial",
+ body_font_size = 12,
+ header_font_size = 14
+)
+
+blue_format(ft, ...)
+
+orange_format(ft, ...)
+
+red_format(ft, ...)
+
+purple_format(ft, ...)
+
+autoslider_dose_format(ft, header_vals = names(ft))
+
+white_format(ft, ...)
+
+black_format(ft, ...)
flextable object
Hex color code, default to deep sky blue
Hex color code, default to alice blue
Hex color code, default to slate gray
Hex color code, default to slate gray
Font name, default to arial
Font size of the table content, default to 12
Font size of the table header, default to 14
arguments passed to program
Header
autoslider_format()
: User defined color code and font size
blue_format()
: Blue color theme
orange_format()
: Orange color theme
red_format()
: Red color theme
purple_format()
: Purple color theme
autoslider_dose_format()
: `AutoslideR` dose formats
white_format()
: White color theme
black_format()
: Black color theme
center_figure_loc.Rd
Create location container to center the figure, based on ppt size and +user specified figure size
+center_figure_loc(fig_width, fig_height, ppt_width, ppt_height)
Location for a placeholder from scratch
+center_table_loc.Rd
create location container to center the table
+center_table_loc(ft, ppt_width, ppt_height)
Location for a placeholder
+decorate-VTableTree-method.Rd
Decorate TableTree
+# S4 method for class 'VTableTree'
+decorate(x, titles = "", footnotes = "", paper = "P8", for_test = FALSE, ...)
A VTableTree object representing the data to be decorated.
Title to be added to the table.
Footnote to be added to the table
Orientation and font size as string, e.g. "P8"; "L11"
`logic` CICD parameter
Additional arguments passed to the decoration function.
decorate-listing_df-method.Rd
decorate listing
+# S4 method for class 'listing_df'
+decorate(x, titles = "", footnotes = "", paper = "P8", for_test = FALSE, ...)
A listing_df object representing the data to be decorated.
Title to be added to the table.
Footnote to be added to the table
Orientation and font size as string, e.g. "P8"; "L11"
`logic` CICD parameter
Additional arguments. not used.
decorate.ggplot.Rd
Decorate ggplot object
+decorate.ggplot(
+ x,
+ titles = "",
+ footnotes = "",
+ paper = "L11",
+ for_test = FALSE,
+ ...
+)
The paper default paper size, `L11`, indicate that the fontsize is 11. +The fontsize of the footnotes, is the fontsize of the titles minus 2.
+decorate.grob.Rd
decorate grob
+decorate.grob(x, titles, footnotes, paper = "L11", for_test = FALSE, ...)
The paper default paper size, `L11`, indicate that the fontsize is 11. +The fontsize of the footnotes, is the fontsize of the titles minus 2.
+decorate.list.Rd
decorate list of grobs
+decorate.list(x, titles, footnotes, paper = "L11", for_test = FALSE, ...)
The paper default paper size, `L11`, indicate that the fontsize is 11. +The fontsize of the footnotes, is the fontsize of the titles minus 2.
+decorate_outputs.Rd
Decorate outputs with titles and footnotes
+decorate_outputs(
+ outputs,
+ generic_title = NULL,
+ generic_footnote = "Confidential and for internal use only",
+ version_label = get_version_label_output(),
+ for_test = FALSE
+)
`generic_title` and `generic_footnote` will be added to *all* outputs. The use +case is to add information such as protocol number and snapshot date defined +in a central place (e.g. metadata.yml) to *every* output.
+`version_label` must be either `"DRAFT"`, `"APPROVED"` or `NULL`. By default, +when outputs are created on the master branch it is set to `NULL`, i.e. no +version label will be displayed. Otherwise `"DRAFT"` will be added. To add +`"APPROVED"` to the title you will need to explicitly set `version_label = "APPROVED"`.
+eg_adae.Rd
Cached ADAE data
+data(eg_adae)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 1934 rows and 93 columns.
eg_adeg.Rd
Cached ADEG data
+data(eg_adeg)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 13600 rows and 88 columns.
eg_adex.Rd
Cached ADEX data
+data(eg_adex)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 6400 rows and 79 columns.
eg_adlb.Rd
Cached +ADLB data
+data(eg_adlb)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 8400 rows and 102 columns.
eg_adrs.Rd
Cached ADRS data
+data(eg_adrs)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 3200 rows and 65 columns.
eg_adsl.Rd
Cached ADSL data
+data(eg_adsl)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 400 rows and 55 columns.
eg_adtr.Rd
Cached ADTR data
+data(eg_adtr)
An object of class data.frame
with 2800 rows and 76 columns.
eg_adtte.Rd
Cached ADTTE data
+data(eg_adtte)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 2000 rows and 67 columns.
eg_advs.Rd
Cached ADVS data
+data(eg_advs)
An object of class tbl_df
(inherits from tbl
, data.frame
) with 16800 rows and 87 columns.
fastDoCall.Rd
copied from ms showcase app
+fastDoCall(what, args, quote = FALSE, envir = parent.frame())
either a function or a non-empty character string naming the function to be called.
a list of arguments to the function call. The names attribute of args gives the argument names.
a logical value indicating whether to quote the arguments.
an environment within which to evaluate the call. This will be most useful if what is a character +string and the arguments are symbols or quoted expressions.
figure_to_slide.Rd
Add figure to slides
+figure_to_slide(
+ ppt,
+ content,
+ decor = TRUE,
+ fig_width,
+ fig_height,
+ figure_loc = ph_location_type("body"),
+ ...
+)
slide page
content to be added
should decoration be added
user specified figure width
user specified figure height
location of the figure. Defaults to `ph_location_type("body")`
arguments passed to program
slide with the added content
+format_date.Rd
`dplyr::case_when()` will check all RHS expressions on the input, this means if +these expressions return warnings, they will happen even then the input doesn't +doesn't satisfy the LHS. For this reason, I had to 'quiet' all `lubridate` functions. +This `format_date()` function was tested with the inputs in the examples, all gave the +expected returned value, so there should be no issues.
+format_date(x)
A vector.
+
+# expected to return "2019"
+format_date("2019")
+#> [1] "2019"
+
+# expected to return "20APR2019"
+format_date("2019-04-20")
+#> [1] "20APR2019"
+
+# expected to return ""
+format_date("")
+#> [1] ""
+
+# expected to return "18JUN2019"
+format_date("2019-06-18T10:32")
+#> [1] "18JUN2019"
+
+# expected to return "APR2019"
+format_date("2019-04")
+#> [1] "APR2019"
+
+
func_wrapper.Rd
function wrapper to pass filtered data
+func_wrapper(func, datasets, spec, verbose = TRUE)
a wrapped function using filtered adam
+gen_notes.Rd
General notes
+gen_notes()
* Default arm variables are set to `"TRT01A"` for safety output, and + `"TRT01P"` for efficacy output
+generate_output.Rd
Generate output and apply filters, titles, and footnotes
+generate_output(program, datasets, spec, verbose_level = 2, ...)
`verbose_level` is used to control how many messages are printed out. +By default, `2` will show all filter messages and show output generation message. +`1` will show output generation message only. +`0` will display no message.
+filters::load_filters(
+ yaml_file = system.file("filters.yml", package = "autoslider.core"),
+ overwrite = TRUE
+)
+
+spec_file <- system.file("spec.yml", package = "autoslider.core")
+spec <- spec_file %>% read_spec()
+#> Error in read_spec(.): could not find function "read_spec"
+
+data <- list(
+ adsl = eg_adsl,
+ adae = eg_adae
+)
+generate_output("t_ae_slide", data, spec$t_ae_slide_SE)
+#> Error: object 'spec' not found
+
+
generate_outputs.Rd
Generate all outputs from a spec
+generate_outputs(spec, datasets, verbose_level = 2)
`verbose_level` is used to control how many messages are printed out. +By default, `2` will show all filter messages and show output generation message. +`1` will show output generation message only. +`0` will display no message.
+library(dplyr, warn.conflicts = FALSE)
+data <- list(
+ adsl = eg_adsl,
+ adae = eg_adae
+)
+filters::load_filters(
+ yaml_file = system.file("filters.yml", package = "autoslider.core"),
+ overwrite = TRUE
+)
+
+spec_file <- system.file("spec.yml", package = "autoslider.core")
+spec_file %>%
+ read_spec() %>%
+ filter_spec(output %in% c("t_dm_slide_IT", "t_ae_slide_SE")) %>%
+ generate_outputs(datasets = data)
+#> Error in filter_spec(., output %in% c("t_dm_slide_IT", "t_ae_slide_SE")): could not find function "filter_spec"
+
+
generate_slides.Rd
generate slides based on output from enableRF
+generate_slides(
+ outputs,
+ outfile = "output.pptx",
+ template = file.path(system.file(package = "autoslider.core"), "theme/basic.pptx"),
+ fig_width = 9,
+ fig_height = 6,
+ t_lpp = 20,
+ t_cpp = 200,
+ l_lpp = 20,
+ l_cpp = 150,
+ ...
+)
List of output
Out file path
Template file path
figure width in inch
figure height in inch
An integer specifying the table lines per page
+Specify this optional argument to modify the length of all of the table displays
An integer specifying the table columns per page
+Specify this optional argument to modify the width of all of the table displays
An integer specifying the listing lines per page
+Specify this optional argument to modify the length of all of the listings display
An integer specifying the listing columns per page
+Specify this optional argument to modify the width of all of the listings display
arguments passed to program
+# Example 1. When applying to the whole pipeline
+data <- list(
+ adsl = eg_adsl %>% dplyr::mutate(FASFL = SAFFL),
+ adae = eg_adae
+)
+
+
+filters::load_filters(
+ yaml_file = system.file("filters.yml", package = "autoslider.core"),
+ overwrite = TRUE
+)
+
+
+spec_file <- system.file("spec.yml", package = "autoslider.core")
+spec_file %>%
+ read_spec() %>%
+ filter_spec(program %in% c("t_dm_slide")) %>% # removed "l_dsl01_slide" atm
+ generate_outputs(datasets = data) %>%
+ decorate_outputs() %>%
+ generate_slides()
+#> Error in get_version_label_output(): could not find function "get_version_label_output"
+
+# Example 2. When applying to an rtable object or an rlisting object
+adsl <- eg_adsl
+t_dm_slide(adsl, "TRT01P", c("SEX", "AGE")) %>%
+ generate_slides()
+#> Error in t_dm_slide_to_df(result): could not find function "t_dm_slide_to_df"
+
+l_dsl01_slide(adsl) %>% generate_slides()
+#> Error in l_dsl01_slide(adsl): could not find function "l_dsl01_slide"
+
get_proper_title.Rd
Adjust title line break and font size
+get_proper_title(title, max_char = 60, title_color = "#1C2B39")
+ All functions+ + |
+ |
---|---|
+ + | +autoslider.core Package |
+
+
|
+ Table color and font |
+
+ + | +Create location container to center the figure, based on ppt size and user specified figure size |
+
+ + | +create location container to center the table |
+
+ + | +Assert function to check the cutoff |
+
+ + | +Concatenate arguments into a string |
+
+ + | +Decorate TableTree |
+
+ + | +decorate listing |
+
+ + | +generic function decorate |
+
+ + | +decorate method for autoslider_error class |
+
+ + | +default method to decorate |
+
+ + | +Decorate ggplot object |
+
+ + | +decorate grob |
+
+ + | +decorate list of grobs |
+
+ + | +Decorate outputs |
+
+ + | +Cached ADAE |
+
+ + | +Cached ADEG |
+
+ + | +Cached ADEX |
+
+ + | +Cached ADLB |
+
+ + | +Cached ADRS |
+
+ + | +Cached ADSL |
+
+ + | +Cached ADTR |
+
+ + | +Cached ADTTE |
+
+ + | +Cached ADVS |
+
+ + | +Does do.call quicker, and avoids issues with debug mode within do.call |
+
+ + | +Add figure to slides |
+
+ + | +Format of xx.xx (xx.xx, xx.xx) |
+
+ + | +Convert dates from `yyyy-mm-dd` format into 20APR2019 format `Datetime` format removes the time and outputs date in the same way Able to handle truncated dates as well (e.g. just the year or year and month) |
+
+ + | +function wrapper to pass filtered data |
+
+ + | +General notes |
+
+ + | +Generate output and apply filters, titles, and footnotes |
+
+ + | +Generate all outputs from a spec |
+
+ + | +generate slides based on output from enableRF |
+
+ + | +Adjust title line break and font size |
+
+ + | +Checker of data frame display per patient (or not) |
+
+ + | +Build side by side layout by cbind |
+
+ + | +Build side by side layout by cbind |
+
+ + | +Refactor active arm |
+
+ + | +Replace NAs to NA |
+
+ + | +Format of (xx%, xx%) |
+
+ + | +Placeholder for ph_with_img |
+
+ + | +Preprocess t_dd function |
+
+ + | +Preprocess t_ds function |
+
+ + | +Print decorated grob |
+
+ + | +Print decorated grob set |
+
+ + | +survival proportion afun |
+
+ + | +survival time afun |
+
+ + | +Generate flextable for preview first page |
+
+ + | +Adverse event table |
+
+ + | +Adverse event summary table |
+
+ + | +Table of AEs of Special Interest adapted from https://insightsengineering.github.io/tlg-catalog/stable/tables/adverse-events/aet01_aesi.html |
+
+ + | +Death table |
+
+ + | +Demographic table |
+
+ + | +DOR table |
+
+ + | +Add decorated flextable to slides |
+
+ + | +To flextable |
+
+ + | +s3 method for to_flextable |
+
+ + | +Covert rtables object to flextable |
+
+ + | +To flextable |
+
+ + | +convert data.frame to flextable |
+
+ + | +default method to to_flextable |
+
+ + | +convert listing to flextable |
+
+ + | +Convert list of numbers to vectors |
+
+ + | +Format of xx.xx (xx.x) |
+
+ + | +Format of xx.xx (xx.xx) |
+
lyt_to_side_by_side.Rd
Build side by side layout by cbind
+lyt_to_side_by_side(lyt, anl, side_by_side = NULL)
lyt_to_side_by_side_two_data.Rd
Build side by side layout by cbind
+lyt_to_side_by_side_two_data(lyt, anl, alt_counts_df, side_by_side = NULL)
mutate_actarm.Rd
Refactor active arm
+ph_with_img.Rd
Placeholder for ph_with_img
+ph_with_img(ppt, figure, fig_width, fig_height, figure_loc)
preprocess_t_dd.Rd
Preprocess t_dd function
+preprocess_t_ds.Rd
Preprocess t_ds function
+print.decoratedGrob.Rd
Print decorated grob
+# S3 method for class 'decoratedGrob'
+print(x, ...)
print.decoratedGrobSet.Rd
Print decorated grob set
+# S3 method for class 'decoratedGrobSet'
+print(x, ...)
s_proportion_1.Rd
survival proportion afun
+s_proportion_1(
+ x,
+ conf_level = 0.95,
+ method = c("waldcc", "wald", "clopper-pearson", "wilson", "agresti-coull", "jeffreys"),
+ long = FALSE
+)
s_surv_time_1.Rd
survival time afun
+s_surv_time_1(df, .var, is_event, control = control_surv_time())
slides_preview.Rd
Generate flextable for preview first page
+slides_preview(x)
# Example 1. preview table
+library(dplyr)
+adsl <- eg_adsl
+t_dm_slide(adsl, "TRT01P", c("SEX", "AGE")) %>% slides_preview()
+#> Error in t_dm_slide_to_df(result): could not find function "t_dm_slide_to_df"
+
+# Example 2. preview listing
+l_dsl01_slide(adsl) %>% slides_preview()
+#> Error in l_dsl01_slide(adsl): could not find function "l_dsl01_slide"
+
t_ae_slide.Rd
Adverse event table
+t_ae_slide(
+ adsl,
+ adae,
+ arm = "TRT01A",
+ split_by_study = FALSE,
+ side_by_side = NULL
+)
rtables object
+* Default arm variables are set to `"TRT01A"` for safety output, and + `"TRT01P"` for efficacy output
+adsl <- eg_adsl %>%
+ dplyr::mutate(TRT01A = factor(TRT01A, levels = c("A: Drug X", "B: Placebo")))
+adae <- eg_adae %>%
+ dplyr::mutate(
+ TRT01A = factor(TRT01A, levels = c("A: Drug X", "B: Placebo")),
+ ATOXGR = AETOXGR
+ )
+out <- t_ae_slide(adsl, adae, "TRT01A")
+print(out)
+#> AE event table
+#>
+#> ———————————————————————————————————————————————————————————————————————
+#> MedDRA System Organ Class A: Drug X B: Placebo All Patients
+#> MedDRA Preferred Term N (%) (N=134) (N=134) (N=268)
+#> ———————————————————————————————————————————————————————————————————————
+#> cl A.1 78 (58.2%) 75 (56.0%) 153 (57.1%)
+#> dcd A.1.1.1.2 48 (35.8%) 48 (35.8%) 96 (35.8%)
+#> dcd A.1.1.1.1 50 (37.3%) 45 (33.6%) 95 (35.4%)
+#> cl B.2 79 (59.0%) 74 (55.2%) 153 (57.1%)
+#> dcd B.2.2.3.1 48 (35.8%) 54 (40.3%) 102 (38.1%)
+#> dcd B.2.1.2.1 49 (36.6%) 44 (32.8%) 93 (34.7%)
+#> cl D.1 79 (59.0%) 67 (50.0%) 146 (54.5%)
+#> dcd D.1.1.1.1 50 (37.3%) 42 (31.3%) 92 (34.3%)
+#> dcd D.1.1.4.2 48 (35.8%) 42 (31.3%) 90 (33.6%)
+#> cl D.2 47 (35.1%) 58 (43.3%) 105 (39.2%)
+#> dcd D.2.1.5.3 47 (35.1%) 58 (43.3%) 105 (39.2%)
+#> cl B.1 47 (35.1%) 49 (36.6%) 96 (35.8%)
+#> dcd B.1.1.1.1 47 (35.1%) 49 (36.6%) 96 (35.8%)
+#> cl C.1 43 (32.1%) 46 (34.3%) 89 (33.2%)
+#> dcd C.1.1.1.3 43 (32.1%) 46 (34.3%) 89 (33.2%)
+#> cl C.2 35 (26.1%) 48 (35.8%) 83 (31.0%)
+#> dcd C.2.1.2.1 35 (26.1%) 48 (35.8%) 83 (31.0%)
+generate_slides(out, "ae.pptx")
+#> [1] "AE event table"
+#> [1] "AE event table (cont.)"
+
t_ae_summ_slide.Rd
Adverse event summary table
+t_ae_summ_slide(
+ adsl,
+ adae,
+ arm = "TRT01A",
+ dose_adjust_flags = NA,
+ dose_adjust_labels = NA,
+ gr34_highest_grade_only = TRUE
+)
ADSL dataset, dataframe
ADAE dataset, dataframe
Arm variable, character, "`TRT01A" by default.
Character or a vector of characters. Each character is a variable +name in adae dataset. These variables are Logical vectors which flag AEs +leading to dose adjustment, such as drug discontinuation, dose interruption +and reduction. The flag can be related to any drug, or a specific drug.
Character or a vector of characters. Each character represents
+a label displayed in the AE summary table (e.g. AE leading to discontinuation
+from drug X). The order of the labels should match the order of variable
+names in dose_adjust_flags
.
A logical value. Default is TRUE, such that +only patients with the highest AE grade as 3 or 4 are included for the count of the "Grade 3-4 AE" and +"Treatment-related Grade 3-4 AE" ; set it to FALSE if +you want to include patients with the highest AE grade as 5.
an rtables object
+ADSL <- eg_adsl
+ADAE <- eg_adae
+
+ADAE <- ADAE %>%
+ dplyr::mutate(ATOXGR = AETOXGR)
+t_ae_summ_slide(adsl = ADSL, adae = ADAE)
+#> Warning: Non-unique sibling analysis table names. Using Labels instead. Use the table_names argument to analyze to avoid this when analyzing the same variable multiple times.
+#> occured at (row) path: root
+#> AE summary table
+#>
+#> ———————————————————————————————————————————————————————————————————————————————————
+#> A: Drug X B: Placebo C: Combination All Patients
+#> (N=134) (N=134) (N=132) (N=400)
+#> ———————————————————————————————————————————————————————————————————————————————————
+#> All grade AEs, any cause 100 (74.6%) 98 (73.1%) 103 (78.0%) 301 (75.2%)
+#> Related 86 (64.2%) 85 (63.4%) 92 (69.7%) 263 (65.8%)
+#> Grade 3-4 AEs 26 (19.4%) 31 (23.1%) 29 (22.0%) 86 (21.5%)
+#> Related 13 (9.7%) 18 (13.4%) 15 (11.4%) 46 (11.5%)
+#> Grade 5 AE 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> Related 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> SAEs 85 (63.4%) 80 (59.7%) 87 (65.9%) 252 (63.0%)
+#> Related 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+
+# add flag for ae leading to dose reduction
+ADAE$reduce_flg <- ifelse(ADAE$AEACN == "DOSE REDUCED", TRUE, FALSE)
+t_ae_summ_slide(
+ adsl = ADSL, adae = ADAE,
+ dose_adjust_flags = c("reduce_flg"),
+ dose_adjust_labels = c("AE leading to dose reduction of drug X")
+)
+#> Warning: Non-unique sibling analysis table names. Using Labels instead. Use the table_names argument to analyze to avoid this when analyzing the same variable multiple times.
+#> occured at (row) path: root
+#> AE summary table
+#>
+#> —————————————————————————————————————————————————————————————————————————————————————————————————
+#> A: Drug X B: Placebo C: Combination All Patients
+#> (N=134) (N=134) (N=132) (N=400)
+#> —————————————————————————————————————————————————————————————————————————————————————————————————
+#> All grade AEs, any cause 100 (74.6%) 98 (73.1%) 103 (78.0%) 301 (75.2%)
+#> Related 86 (64.2%) 85 (63.4%) 92 (69.7%) 263 (65.8%)
+#> Grade 3-4 AEs 26 (19.4%) 31 (23.1%) 29 (22.0%) 86 (21.5%)
+#> Related 13 (9.7%) 18 (13.4%) 15 (11.4%) 46 (11.5%)
+#> Grade 5 AE 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> Related 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> SAEs 85 (63.4%) 80 (59.7%) 87 (65.9%) 252 (63.0%)
+#> Related 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> AE leading to dose reduction of drug X 41 (30.6%) 37 (27.6%) 43 (32.6%) 121 (30.2%)
+# add flgs for ae leading to dose reduction, drug withdraw and drug interruption
+ADAE$withdraw_flg <- ifelse(ADAE$AEACN == "DRUG WITHDRAWN", TRUE, FALSE)
+ADAE$interrup_flg <- ifelse(ADAE$AEACN == "DRUG INTERRUPTED", TRUE, FALSE)
+out <- t_ae_summ_slide(
+ adsl = ADSL, adae = ADAE, arm = "TRT01A",
+ dose_adjust_flags = c("withdraw_flg", "reduce_flg", "interrup_flg"),
+ dose_adjust_labels = c(
+ "AE leading to discontinuation from drug X",
+ "AE leading to drug X reduction",
+ "AE leading to drug X interruption"
+ )
+)
+#> Warning: Non-unique sibling analysis table names. Using Labels instead. Use the table_names argument to analyze to avoid this when analyzing the same variable multiple times.
+#> occured at (row) path: root
+print(out)
+#> AE summary table
+#>
+#> ————————————————————————————————————————————————————————————————————————————————————————————————————
+#> A: Drug X B: Placebo C: Combination All Patients
+#> (N=134) (N=134) (N=132) (N=400)
+#> ————————————————————————————————————————————————————————————————————————————————————————————————————
+#> All grade AEs, any cause 100 (74.6%) 98 (73.1%) 103 (78.0%) 301 (75.2%)
+#> Related 86 (64.2%) 85 (63.4%) 92 (69.7%) 263 (65.8%)
+#> Grade 3-4 AEs 26 (19.4%) 31 (23.1%) 29 (22.0%) 86 (21.5%)
+#> Related 13 (9.7%) 18 (13.4%) 15 (11.4%) 46 (11.5%)
+#> Grade 5 AE 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> Related 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> SAEs 85 (63.4%) 80 (59.7%) 87 (65.9%) 252 (63.0%)
+#> Related 64 (47.8%) 52 (38.8%) 64 (48.5%) 180 (45.0%)
+#> AE leading to discontinuation from drug X 22 (16.4%) 21 (15.7%) 28 (21.2%) 71 (17.8%)
+#> AE leading to drug X reduction 41 (30.6%) 37 (27.6%) 43 (32.6%) 121 (30.2%)
+#> AE leading to drug X interruption 4 (3.0%) 4 (3.0%) 3 (2.3%) 11 (2.8%)
+generate_slides(out, "ae_summary.pptx")
+#> [1] "AE summary table"
+#> [1] "AE summary table (cont.)"
+
t_aesi_slide.Rd
Table of AEs of Special Interest +adapted from https://insightsengineering.github.io/tlg-catalog/stable/tables/adverse-events/aet01_aesi.html
+t_aesi_slide(adsl, adae, aesi, arm = "ACTARM", grad_var = "AETOXGR")
ADSL data set, dataframe
ADAE data set, dataframe.
AESI variable which will act as a filter to select the rows required to create the table. +An example of AESI variable is CQ01NAM.
Arm variable, character, `"ACTARM"` by default.
Grading variable, character, `"AETOXGR"` by default.
rtables object
+adsl <- eg_adsl
+adae <- eg_adae
+adae_atoxgr <- adae %>% dplyr::mutate(ATOXGR = AETOXGR)
+t_aesi_slide(adsl, adae, aesi = "CQ01NAM")
+#> A: Drug X B: Placebo C: Combination
+#> (N=134) (N=134) (N=132)
+#> ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
+#> Total number of patients with at least one AESI 97 (72.4%) 93 (69.4%) 99 (75.0%)
+#> Total number of AESIs 396 380 465
+#> Total number of patients with at least one AESI by worst grade
+#> Grade 1 4 (3.0%) 3 (2.2%) 0
+#> Grade 2 6 (4.5%) 10 (7.5%) 7 (5.3%)
+#> Grade 3 18 (13.4%) 14 (10.4%) 16 (12.1%)
+#> Grade 4 15 (11.2%) 20 (14.9%) 18 (13.6%)
+#> Grade 5 (fatal outcome) 76 (56.7%) 70 (52.2%) 75 (56.8%)
+#> Total number of patients with study drug withdrawn due to AESI 21 (15.7%) 15 (11.2%) 26 (19.7%)
+#> Total number of patients with dose modified/interrupted due to AESI 56 (41.8%) 63 (47.0%) 64 (48.5%)
+#> Total number of patients with treatment received for AESI 91 (67.9%) 93 (69.4%) 95 (72.0%)
+#> Total number of patients with all non-fatal AESIs resolved 23 (17.2%) 17 (12.7%) 19 (14.4%)
+#> Total number of patients with at least one unresolved or ongoing non-fatal AESI 96 (71.6%) 100 (74.6%) 97 (73.5%)
+#> Total number of patients with at least one serious AESI 104 (77.6%) 101 (75.4%) 99 (75.0%)
+#> Total number of patients with at least one related AESI 99 (73.9%) 98 (73.1%) 102 (77.3%)
+t_aesi_slide(adsl, adae, aesi = "CQ01NAM", arm = "ARM", grad_var = "AESEV")
+#> A: Drug X B: Placebo C: Combination
+#> (N=134) (N=134) (N=132)
+#> ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
+#> Total number of patients with at least one AESI 97 (72.4%) 93 (69.4%) 99 (75.0%)
+#> Total number of AESIs 396 380 465
+#> Total number of patients with at least one AESI by worst grade
+#> Mild 4 (3.0%) 3 (2.2%) 0
+#> Moderate 24 (17.9%) 24 (17.9%) 23 (17.4%)
+#> Severe 91 (67.9%) 90 (67.2%) 93 (70.5%)
+#> Total number of patients with study drug withdrawn due to AESI 21 (15.7%) 15 (11.2%) 26 (19.7%)
+#> Total number of patients with dose modified/interrupted due to AESI 56 (41.8%) 63 (47.0%) 64 (48.5%)
+#> Total number of patients with treatment received for AESI 91 (67.9%) 93 (69.4%) 95 (72.0%)
+#> Total number of patients with all non-fatal AESIs resolved 23 (17.2%) 17 (12.7%) 19 (14.4%)
+#> Total number of patients with at least one unresolved or ongoing non-fatal AESI 96 (71.6%) 100 (74.6%) 97 (73.5%)
+#> Total number of patients with at least one serious AESI 104 (77.6%) 101 (75.4%) 99 (75.0%)
+#> Total number of patients with at least one related AESI 99 (73.9%) 98 (73.1%) 102 (77.3%)
+t_aesi_slide(adsl, adae_atoxgr, aesi = "CQ01NAM", grad_var = "ATOXGR")
+#> A: Drug X B: Placebo C: Combination
+#> (N=134) (N=134) (N=132)
+#> ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
+#> Total number of patients with at least one AESI 97 (72.4%) 93 (69.4%) 99 (75.0%)
+#> Total number of AESIs 396 380 465
+#> Total number of patients with at least one AESI by worst grade
+#> Grade 1 4 (3.0%) 3 (2.2%) 0
+#> Grade 2 6 (4.5%) 10 (7.5%) 7 (5.3%)
+#> Grade 3 18 (13.4%) 14 (10.4%) 16 (12.1%)
+#> Grade 4 15 (11.2%) 20 (14.9%) 18 (13.6%)
+#> Grade 5 (fatal outcome) 76 (56.7%) 70 (52.2%) 75 (56.8%)
+#> Total number of patients with study drug withdrawn due to AESI 21 (15.7%) 15 (11.2%) 26 (19.7%)
+#> Total number of patients with dose modified/interrupted due to AESI 56 (41.8%) 63 (47.0%) 64 (48.5%)
+#> Total number of patients with treatment received for AESI 91 (67.9%) 93 (69.4%) 95 (72.0%)
+#> Total number of patients with all non-fatal AESIs resolved 23 (17.2%) 17 (12.7%) 19 (14.4%)
+#> Total number of patients with at least one unresolved or ongoing non-fatal AESI 96 (71.6%) 100 (74.6%) 97 (73.5%)
+#> Total number of patients with at least one serious AESI 104 (77.6%) 101 (75.4%) 99 (75.0%)
+#> Total number of patients with at least one related AESI 99 (73.9%) 98 (73.1%) 102 (77.3%)
+
+
t_dd_slide.Rd
Death table
+t_dd_slide(adsl, arm = "TRT01A", split_by_study = FALSE, side_by_side = NULL)
rtables object
+* Default arm variables are set to `"TRT01A"` for safety output, and + `"TRT01P"` for efficacy output
+
+adsl <- eg_adsl %>% preprocess_t_dd()
+out1 <- t_dd_slide(adsl, "TRT01A")
+print(out1)
+#> Death table
+#>
+#> —————————————————————————————————————————————————————————————————————————————————
+#> A: Drug X B: Placebo C: Combination All Patients
+#> N (%) (N=134) (N=134) (N=132) (N=400)
+#> —————————————————————————————————————————————————————————————————————————————————
+#> All Deaths 25 (18.66%) 23 (17.16%) 22 (16.67%) 70 (17.50%)
+#>
+#> Progressive Disease 8 (32%) 6 (26.1%) 6 (27.3%) 20 (28.6%)
+#> Adverse Events 9 (36%) 7 (30.4%) 10 (45.5%) 26 (37.1%)
+#> Other 8 (32%) 10 (43.5%) 6 (27.3%) 24 (34.3%)
+generate_slides(out1, "dd.pptx")
+#> [1] "Death table"
+
+out2 <- t_dd_slide(adsl, "TRT01A", split_by_study = TRUE)
+print(out2)
+#> Death table
+#>
+#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————
+#> AB12345-1 AB12345-2
+#> N (%) A: Drug X B: Placebo C: Combination A: Drug X B: Placebo C: Combination
+#> ———————————————————————————————————————————————————————————————————————————————————————————————————————————————
+#> All Deaths 12 (19.35%) 13 (17.57%) 7 (10.94%) 13 (18.06%) 10 (16.67%) 15 (22.06%)
+#>
+#> Progressive Disease 4 (33.3%) 3 (23.1%) 3 (42.9%) 4 (30.8%) 3 (30%) 3 (20%)
+#> Adverse Events 5 (41.7%) 5 (38.5%) 2 (28.6%) 4 (30.8%) 2 (20%) 8 (53.3%)
+#> Other 3 (25%) 5 (38.5%) 2 (28.6%) 5 (38.5%) 5 (50%) 4 (26.7%)
+
t_dm_slide.Rd
Demographic table
+ADSL data set, dataframe
Arm variable, character, "`TRT01P" by default.
Characters of variables
see `.stats` from [tern::analyze_vars()]
Split by study, building structured header for tables
"GlobalAsia" or "GlobalAsiaChina" to define the side by side requirement
rtables object
+* Default arm variables are set to `"TRT01A"` for safety output, and + `"TRT01P"` for efficacy output
+
+adsl <- eg_adsl
+out1 <- t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY"))
+#> Error in t_dm_slide_to_df(result): could not find function "t_dm_slide_to_df"
+print(out1)
+#> Error: object 'out1' not found
+generate_slides(out1, "dm.pptx")
+#> Error: object 'out1' not found
+
+out2 <- t_dm_slide(adsl, "TRT01P", c("SEX", "AGE", "RACE", "ETHNIC", "COUNTRY"), split_by_study = TRUE)
+#> Error in t_dm_slide_to_df(result): could not find function "t_dm_slide_to_df"
+print(out2)
+#> Error: object 'out2' not found
+
+
t_dor_slide.Rd
DOR table
+t_dor_slide(adsl, adtte, arm = "TRT01P", refgroup = NULL)
* Default arm variables are set to `"TRT01A"` for safety output, and + `"TRT01P"` for efficacy output
+adsl <- eg_adsl %>%
+ dplyr::mutate(TRT01P = factor(TRT01P, levels = c("A: Drug X", "B: Placebo", "C: Combination")))
+adtte <- eg_adtte %>%
+ dplyr::filter(PARAMCD == "OS") %>%
+ dplyr::mutate(TRT01P = factor(TRT01P, levels = c("A: Drug X", "B: Placebo", "C: Combination")))
+out <- t_dor_slide(adsl, adtte)
+print(out)
+#> DOR slide
+#>
+#> ——————————————————————————————————————————————————————————————————————————
+#> A: Drug X B: Placebo C: Combination
+#> (N=134) (N=134) (N=132)
+#> ——————————————————————————————————————————————————————————————————————————
+#> Responders 134 134 132
+#> With subsequent event (%) 58 (43.3%) 58 (43.3%) 69 (52.3%)
+#> Median (Months, 95% CI) NA (9.3, NA) NA (9.4, NA) 9.4 (7.6, NA)
+generate_slides(out, "dor.pptx")
+#> [1] "DOR slide"
+
table_to_slide.Rd
Add decorated flextable to slides
+table_to_slide(
+ ppt,
+ content,
+ decor = TRUE,
+ table_loc = ph_location_type("body"),
+ ...
+)
Slide with added content
+to_flextable.Ddataframe.Rd
Convert the dataframe into flextable, and merge the cells +that have colspan > 1. align the columns to the middle, and the row.names to +the left. indent the row.names by 10 times indention.
+# S3 method for class 'Ddataframe'
+to_flextable(x, lpp, table_format = table_format, ...)
+
+# S3 method for class 'Ddataframe'
+to_flextable(x, lpp, table_format = table_format, ...)
convert the dataframe object into flextable, and merge the cells +that have colspan > 1. align the columns to the middle, and the row.names to +the left. indent the row.names by 10 times indention. titles are added in headerlines, +footnotes are added in footer lines, +The width of the columns are aligned based on autofit() of officer function. +For paginated table, the width of the 1st column are set as the widest 1st column among paginated tables
+to_flextable.VTableTree.Rd
Covert rtables object to flextable
+# S3 method for class 'VTableTree'
+to_flextable(x, table_format = orange_format, ...)
to_flextable.dVTableTree.Rd
To flextable
+# S3 method for class 'dVTableTree'
+to_flextable(x, lpp, cpp, ...)
decorated rtable(dVTableTree) object
{lpp} from paginate_table. numeric. Maximum lines per page
argument parameters
convert the VTableTree object into flextable, and merge the cells +that have colspan > 1. align the columns to the middle, and the row.names to +the left. indent the row.names by 10 times indention. titles are added in headerlines, +footnotes are added in footer lines, +The width of the columns are aligned based on autofit() of officer function. +For paginated table, the width of the 1st column are set as the widest 1st column among paginated tables
+to_flextable.data.frame.Rd
convert data.frame to flextable
+# S3 method for class 'data.frame'
+to_flextable(
+ x,
+ col_width = NULL,
+ table_format = orange_format,
+ dose_template = FALSE,
+ font_size = 9,
+ ...
+)
to_flextable.default.Rd
default method to to_flextable
+# Default S3 method
+to_flextable(x, ...)
to_flextable.dlisting.Rd
convert listing to flextable
+# S3 method for class 'dlisting'
+to_flextable(x, cpp, lpp, ...)