Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip vbump] prepare for CRAN release #713

Merged
merged 26 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ SECURITY\.md
^Meta$
^\.vscode$
^pkgdown$
LICENSE
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: chevron
Title: Standard TLGs for Clinical Trials Reporting
Version: 0.2.4.9021
Version: 0.2.5
Date: 2023-12-18
Authors@R: c(
person("Liming", "Li", , "[email protected]", role = c("aut", "cre")),
Expand All @@ -16,7 +16,7 @@ Authors@R: c(
)
Description: Standard Table, Listings, and Graphs (TLG) library used in
clinical trials.
License: Apache License 2.0 | file LICENSE
License: Apache License 2.0
URL: https://insightsengineering.github.io/chevron/,
https://github.com/insightsengineering/chevron/
BugReports: https://github.com/insightsengineering/chevron/issues
Expand All @@ -25,9 +25,9 @@ Depends:
Imports:
checkmate (>= 2.1.0),
dplyr (>= 1.1.0),
dunlin (>= 0.1.6.9002),
dunlin (>= 0.1.7),
forcats (>= 1.0.0),
formatters (>= 0.5.4),
formatters (>= 0.5.5),
ggplot2 (>= 3.4.0),
glue (>= 1.0.0),
grid,
Expand All @@ -40,7 +40,7 @@ Imports:
rlistings (>= 0.2.6),
rtables (>= 0.6.5),
BFalquet marked this conversation as resolved.
Show resolved Hide resolved
stringr (>= 1.4.1),
tern (>= 0.9.2),
tern (>= 0.9.3),
tibble (>= 2.0.0),
utils
Suggests:
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# chevron 0.2.4.9021
# chevron 0.2.5

* `MNG01` plot can now be displayed without error bars and can display a continuous temporal scale on the `x` axis.
* Add a `chevron_simple` class only contain main function.
Expand Down
3 changes: 3 additions & 0 deletions R/ael01_nollt.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @param dataset (`character`) the name of a table in the `adam_db` object.
#' @param default_formatting (`list`) the default format of the listing columns. See [`rlistings::as_listing`].
#' @param col_formatting (`list`) the format of specific listing columns. See [`rlistings::as_listing`].
#' @returns the main function returns an `rlistings` object.
#'
#' @details
#' * Removes duplicate rows.
Expand Down Expand Up @@ -47,6 +48,7 @@ ael01_nollt_main <- function(adam_db,
#' @describeIn ael01_nollt Preprocessing
#'
#' @inheritParams ael01_nollt_main
#' @returns the preprocessing function returns a `list` of `data.frame`.
#'
#' @export
#'
Expand All @@ -67,6 +69,7 @@ ael01_nollt_pre <- function(adam_db,
#' @describeIn ael01_nollt Postprocessing
#'
#' @inheritParams gen_args
#' @returns the postprocessing function returns an `rlistings` object or an `ElementaryTable` (null report).
#'
ael01_nollt_post <- function(tlg, ...) {
if (nrow(tlg) == 0) tlg <- null_report
Expand Down
4 changes: 4 additions & 0 deletions R/aet01.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @inheritParams gen_args
#' @param anl_vars Named (`list`) of (`character`) variables the safety variables to be summarized.
#' @param anl_lbls (`character`) of analysis labels.
#' @returns the main function returns an `rtables` object.
#'
#' @details
#' * Does not remove rows with zero counts by default.
Expand Down Expand Up @@ -75,6 +76,7 @@ aet01_main <- function(adam_db,
#' @param anl_vars Named (`list`) of analysis variables.
#' @param anl_lbls (`character`) of labels.
#' @param lbl_vars Named (`list`) of analysis labels.
#' @returns a `PreDataTableLayouts` object.
#' @keywords internal
#'
aet01_lyt <- function(arm_var,
Expand Down Expand Up @@ -126,6 +128,7 @@ aet01_lyt <- function(arm_var,
#' @describeIn aet01 Preprocessing
#'
#' @inheritParams aet01_main
#' @returns the preprocessing function returns a `list` of `data.frame`.
#'
#' @export
#'
Expand Down Expand Up @@ -160,6 +163,7 @@ aet01_pre <- function(adam_db, ...) {
#' @describeIn aet01 Postprocessing
#'
#' @inheritParams gen_args
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#'
#' @export
#'
Expand Down
5 changes: 4 additions & 1 deletion R/aet01_aesi.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @inheritParams gen_args
#' @param aesi_vars (`character`) the `AESI` variables to be included in the summary. Defaults to `NA`.
#' @param grade_groups (`list`) the grade groups to be displayed.
#' @returns the main function returns an `rtables` object.
#' @details
#' * Does not remove rows with zero counts by default.
#'
Expand Down Expand Up @@ -78,7 +79,7 @@ aet01_aesi_main <- function(adam_db,
#'
#' @inheritParams gen_args
#' @param lbl_aesi_vars (`character`) the labels of the `AESI` variables to be summarized.
#'
#' @returns a `PreDataTableLayouts` object.
#' @keywords internal
#'
aet01_aesi_lyt <- function(arm_var,
Expand Down Expand Up @@ -118,6 +119,7 @@ aet01_aesi_lyt <- function(arm_var,
#' @describeIn aet01_aesi Preprocessing
#'
#' @inheritParams aet01_aesi_main
#' @returns the preprocessing function returns a `list` of `data.frame`.
#'
#' @export
#'
Expand Down Expand Up @@ -203,6 +205,7 @@ aet01_aesi_pre <- function(adam_db,
#' @describeIn aet01_aesi Postprocessing
#'
#' @inheritParams gen_args
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#'
#' @export
#'
Expand Down
5 changes: 3 additions & 2 deletions R/aet02.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ aet02_label <- c(
#'
#' @inheritParams gen_args
#' @param summary_labels (`list`) of summarize labels. See details.
#' @returns the main function returns an `rtables` object.
#'
#' @details
#' * Numbers represent absolute numbers of subject and fraction of `N`, or absolute number of event when specified.
Expand Down Expand Up @@ -76,7 +77,7 @@ aet02_main <- function(adam_db,
#' @describeIn aet02 Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
aet02_pre <- function(adam_db, row_split_var = "AEBODSYS", ...) {
Expand All @@ -91,7 +92,7 @@ aet02_pre <- function(adam_db, row_split_var = "AEBODSYS", ...) {
#' @describeIn aet02 Postprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#' @export
#'
aet02_post <- function(tlg, row_split_var = "AEBODSYS", prune_0 = TRUE, ...) {
Expand Down
7 changes: 4 additions & 3 deletions R/aet03.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @describeIn aet03 Main TLG function
#'
#' @inheritParams gen_args
#' @returns the main function returns an `rtables` object.
#'
#' @details
#' * Default Adverse Events by Greatest Intensity table.
Expand Down Expand Up @@ -54,7 +55,7 @@ aet03_main <- function(adam_db,
#' @param lbl_aebodsys (`string`) text label for `AEBODSYS`.
#' @param lbl_aedecod (`string`) text label for `AEDECOD`.
#' @param intensity_grade (`character`) describing the intensity levels present in the dataset.
#'
#' @returns a `PreDataTableLayouts` object.
#' @keywords internal
#'
aet03_lyt <- function(arm_var,
Expand Down Expand Up @@ -107,7 +108,7 @@ aet03_lyt <- function(arm_var,
#' @describeIn aet03 Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
aet03_pre <- function(adam_db, ...) {
Expand All @@ -127,7 +128,7 @@ aet03_pre <- function(adam_db, ...) {
#' @describeIn aet03 Postprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#' @export
#'
aet03_post <- function(tlg, prune_0 = TRUE, ...) {
Expand Down
7 changes: 4 additions & 3 deletions R/aet04.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#'
#' @inheritParams gen_args
#' @param grade_groups (`list`) putting in correspondence toxicity grades and labels.
#' @returns the main function returns an `rtables` object.
#'
#' @details
#' * Numbers represent absolute numbers of patients and fraction of `N`, or absolute number of event when specified.
Expand Down Expand Up @@ -70,7 +71,7 @@ aet04_main <- function(adam_db,
#' @param lbl_aebodsys (`string`) text label for `AEBODSYS`.
#' @param lbl_aedecod (`string`) text label for `AEDECOD`.
#' @param grade_groups (`list`) putting in correspondence toxicity grades and labels.
#'
#' @returns a `PreDataTableLayouts` object.
#' @keywords internal
#'
aet04_lyt <- function(arm_var,
Expand Down Expand Up @@ -130,7 +131,7 @@ aet04_lyt <- function(arm_var,
#' @describeIn aet04 Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
aet04_pre <- function(adam_db, ...) {
Expand All @@ -148,7 +149,7 @@ aet04_pre <- function(adam_db, ...) {
#' @describeIn aet04 Postprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#' @export
#'
aet04_post <- function(tlg, prune_0 = TRUE, ...) {
Expand Down
6 changes: 4 additions & 2 deletions R/aet05.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @param dataset (`string`) the name of a table in the `adam_db` object.
#' @param arm_var (`string`) the arm variable used for arm splitting.
#' @param ... Further arguments passed to `tern::control_incidence_rate()`.
#' @returns the main function returns an `rtables` object.
#'
#' @details
#' * Total patient-years at risk is the sum over all patients of the time intervals (in years).
Expand Down Expand Up @@ -68,6 +69,7 @@ aet05_main <- function(adam_db,
#' @param n_events (`string`) variable to count the number of events observed.
#' @param control (`list`) parameters for estimation details, specified by using the helper function
#' control_incidence_rate().
#' @returns a `PreDataTableLayouts` object.
#'
#' @keywords internal
#'
Expand All @@ -90,7 +92,7 @@ aet05_lyt <- function(arm_var,
#' @describeIn aet05 Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
aet05_pre <- function(adam_db, dataset = "adsaftte", ...) {
Expand All @@ -106,7 +108,7 @@ aet05_pre <- function(adam_db, dataset = "adsaftte", ...) {
#' @describeIn aet05 Postprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#' @export
#'
aet05_post <- function(tlg, prune_0 = FALSE, ...) {
Expand Down
2 changes: 1 addition & 1 deletion R/aet05_all.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @describeIn aet05_all Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
aet05_all_pre <- function(adam_db, dataset = "adsaftte", ...) {
Expand Down
8 changes: 4 additions & 4 deletions R/aet10.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @describeIn aet10 Main TLG function
#'
#' @inheritParams gen_args
#'
#' @returns the main function returns an `rtables` object
#' @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`.
Expand Down Expand Up @@ -47,7 +47,7 @@ aet10_main <- function(adam_db,
#'
#' @inheritParams gen_args
#' @param lbl_aedecod (`character`) text label for `AEDECOD`.
#'
#' @returns a `PreDataTableLayouts` object.
#' @keywords internal
#'
aet10_lyt <- function(arm_var,
Expand All @@ -65,7 +65,7 @@ aet10_lyt <- function(arm_var,
#' @describeIn aet10 Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
aet10_pre <- function(adam_db, ...) {
Expand All @@ -79,7 +79,7 @@ aet10_pre <- function(adam_db, ...) {
#'
#' @inheritParams gen_args
#' @param atleast given cut-off in numeric format, default is `0.05`
#'
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#' @export
#'
aet10_post <- function(tlg, atleast = 0.05, ...) {
Expand Down
6 changes: 5 additions & 1 deletion R/assertions.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' Check variable only has one unique value.
#' @param x value vector.
#' @param label (`string`) label of input.
#' @returns invisible `NULL` or an error message if the criteria are not fulfilled.
#' @export
assert_single_value <- function(x, label = deparse(substitute(x))) {
unique_param_val <- unique(x)
Expand All @@ -26,6 +27,7 @@ assert_single_value <- function(x, label = deparse(substitute(x))) {
#' @param na_ok (`flag`) whether NA value is allowed
#' @param empty_ok (`flag`) whether length 0 value is allowed.
#' @param ... Further arguments to methods.
#' @returns invisible `NULL` or an error message if the criteria are not fulfilled.
#' @export
assert_valid_var <- function(x, label, na_ok, empty_ok, ...) {
UseMethod("assert_valid_var")
Expand Down Expand Up @@ -108,7 +110,7 @@ assert_valid_var.default <- function(x, label = deparse(substitute(x)), na_ok =
#' @param types Named (`list`) of type of the input.
#' @param ... further arguments for `assert_valid_var`. Please note that different methods have different arguments
#' so if provided make sure the variables to check is of the same class.
#'
#' @returns invisible `TRUE` or an error message if the criteria are not fulfilled.
#' @export
assert_valid_variable <- function(df, vars, label = deparse(substitute(df)), types = NULL, ...) {
assert_names(colnames(df), must.include = vars, what = "colnames")
Expand Down Expand Up @@ -137,6 +139,7 @@ assert_valid_variable <- function(df, vars, label = deparse(substitute(df)), typ
#' @param x Object to check the type.
#' @param types (`character`) possible types to check.
#' @param label (`string`) label.
#' @returns invisible `NULL` or an error message if the criteria are not fulfilled.
assert_valid_type <- function(x, types, label = deparse(substitute(x))) {
if (!any(vapply(types, is, object = x, FUN.VALUE = TRUE))) {
abort(
Expand All @@ -157,6 +160,7 @@ assert_valid_type <- function(x, types, label = deparse(substitute(x))) {
#' @param var (`string`) variable to check.
#' @param lab1 (`string`) label hint for `df1`.
#' @param lab2 (`string`) label hint for `df2`.
#' @returns invisible `NULL` or an error message if the criteria are not fulfilled.
assert_valid_var_pair <- function(df1, df2, var, lab1 = deparse(substitute(df1)), lab2 = deparse(substitute(df2))) {
assert_data_frame(df1)
assert_data_frame(df2)
Expand Down
6 changes: 4 additions & 2 deletions R/cfbt01.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @param .stats (`character`) statistics names, see `tern::analyze_vars()`.
#' @param skip Named (`list`) of visit values that need to be inhibited.
#' @param ... additional arguments like `.indent_mods`, `.labels`.
#' @returns the main function returns an `rtables` object.
#'
#' @details
#' * The `Analysis Value` column, displays the number of patients, the mean, standard deviation, median and range of
Expand Down Expand Up @@ -116,6 +117,7 @@ cfbt01_main <- function(adam_db,
#' @param summaryvars_lbls (`character`) the label of the variables to be analyzed.
#' @param row_split_lbl (`character`) label of further row splits.
#' @param visitvar (`string`) typically one of `"AVISIT"` or user-defined visit incorporating `"ATPT"`.
#' @returns a `PreDataTableLayouts` object.
#'
#' @keywords internal
#'
Expand Down Expand Up @@ -177,7 +179,7 @@ cfbt01_lyt <- function(arm_var,
#' @describeIn cfbt01 Preprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the preprocessing function returns a `list` of `data.frame`.
#' @export
#'
cfbt01_pre <- function(adam_db, dataset, ...) {
Expand All @@ -196,7 +198,7 @@ cfbt01_pre <- function(adam_db, dataset, ...) {
#' @describeIn cfbt01 Postprocessing
#'
#' @inheritParams gen_args
#'
#' @returns the postprocessing function returns an `rtables` object or an `ElementaryTable` (null report).
#' @export
cfbt01_post <- function(tlg, prune_0 = TRUE, ...) {
if (prune_0) {
Expand Down
Loading