diff --git a/DESCRIPTION b/DESCRIPTION index 0e95dafafc..4b1a48486b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tern Title: Create Common TLGs Used in Clinical Trials -Version: 0.7.9.9004 -Date: 2022-08-30 +Version: 0.7.9.9005 +Date: 2022-09-09 Authors@R: c( person("Joe", "Zhu", , "joe.zhu@roche.com", role = c("aut", "cre")), person("Daniel", "Sabanés Bové", , "daniel.sabanes_bove@roche.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 2df56724d2..cfb2ffa516 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# tern 0.7.9.9004 +# tern 0.7.9.9005 ### Enhancements * Added `DescTools` `BinomDiffCI` function within `tern`. diff --git a/R/desctools_binom_diff.R b/R/desctools_binom_diff.R index 26fa77601d..3a62249f37 100644 --- a/R/desctools_binom_diff.R +++ b/R/desctools_binom_diff.R @@ -39,7 +39,10 @@ h_recycle <- function(...) { #' rsp <- sample(c(TRUE, FALSE), replace = TRUE, size = 20) #' grp <- factor(c(rep("A", 10), rep("B", 10))) #' tbl <- table(grp, factor(rsp, levels = c(TRUE, FALSE))) -#' desctools_binom(tbl[1], sum(tbl[1], tbl[3]), tbl[2], sum(tbl[2], tbl[4]), conf.level = 0.90, method = "waldcc") +#' desctools_binom( +#' tbl[1], sum(tbl[1], tbl[3]), tbl[2], sum(tbl[2], tbl[4]), +#' conf.level = 0.90, method = "waldcc" +#' ) #' } #' #' @keywords internal diff --git a/R/g_lineplot.R b/R/g_lineplot.R index aab6aa08e5..58511ff22f 100644 --- a/R/g_lineplot.R +++ b/R/g_lineplot.R @@ -81,8 +81,9 @@ #' @examples #' library(nestcolor) #' -#' adsl <- scda::synthetic_cdisc_data("latest")$adsl -#' adlb <- scda::synthetic_cdisc_data("latest")$adlb +#' cached_data <- scda::synthetic_cdisc_data("latest") +#' adsl <- cached_data$adsl +#' adlb <- cached_data$adlb #' adlb <- dplyr::filter(adlb, ANL01FL == "Y", PARAMCD == "ALT", AVISIT != "SCREENING") #' adlb$AVISIT <- droplevels(adlb$AVISIT) #' adlb <- dplyr::mutate(adlb, AVISIT = forcats::fct_reorder(AVISIT, AVISITN, min)) diff --git a/R/summarize_ancova.R b/R/summarize_ancova.R index da04a4c97d..857ac12f9a 100644 --- a/R/summarize_ancova.R +++ b/R/summarize_ancova.R @@ -118,7 +118,11 @@ h_ancova <- function(.var, #' #' # Internal function - s_ancova #' \dontrun{ -#' s_ancova(df, .var, .df_row, variables, .ref_group, .in_ref_col = FALSE, conf_level, interaction_y = FALSE, interaction_item = NULL) +#' s_ancova( +#' df, .var, .df_row, variables, .ref_group, +#' .in_ref_col = FALSE, +#' conf_level, interaction_y = FALSE, interaction_item = NULL +#' ) #' } #' #' @keywords internal @@ -213,7 +217,11 @@ s_ancova <- function(df, #' @examples #' # Internal function - a_ancova #' \dontrun{ -#' a_ancova(df, .var, .df_row, variables, .ref_group, .in_ref_col = FALSE, interaction_y = FALSE, interaction_item = NULL, conf_level) +#' a_ancova( +#' df, .var, .df_row, variables, .ref_group, +#' .in_ref_col = FALSE, +#' interaction_y = FALSE, interaction_item = NULL, conf_level +#' ) #' } #' #' @keywords internal @@ -240,8 +248,10 @@ a_ancova <- make_afun( #' library(rtables) #' library(dplyr) #' -#' adsl <- synthetic_cdisc_data("rcd_2022_02_28")$adsl -#' adqs <- synthetic_cdisc_data("rcd_2022_02_28")$adqs +#' cached_data <- synthetic_cdisc_data("rcd_2022_02_28") +#' +#' adsl <- cached_data$adsl +#' adqs <- cached_data$adqs #' adqs_single <- adqs %>% #' filter( #' AVISIT == "WEEK 1 DAY 8", # single time point @@ -270,8 +280,9 @@ a_ancova <- make_afun( #' build_table(adqs_single, alt_counts_df = adsl) #' #' # Another example: count the interaction between rows and columns into consideration -#' adsl <- synthetic_cdisc_data("rcd_2022_02_28")$adsl -#' adqs <- synthetic_cdisc_data("rcd_2022_02_28")$adqs +#' +#' adsl <- cached_data$adsl +#' adqs <- cached_data$adqs #' adqs_single <- adqs %>% #' filter(AVISIT %in% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 5 DAY 36")) %>% #' droplevels() %>% diff --git a/man/desctools_binom.Rd b/man/desctools_binom.Rd index c9663bd4db..eecc0b1539 100644 --- a/man/desctools_binom.Rd +++ b/man/desctools_binom.Rd @@ -84,7 +84,10 @@ set.seed(2) rsp <- sample(c(TRUE, FALSE), replace = TRUE, size = 20) grp <- factor(c(rep("A", 10), rep("B", 10))) tbl <- table(grp, factor(rsp, levels = c(TRUE, FALSE))) -desctools_binom(tbl[1], sum(tbl[1], tbl[3]), tbl[2], sum(tbl[2], tbl[4]), conf.level = 0.90, method = "waldcc") +desctools_binom( + tbl[1], sum(tbl[1], tbl[3]), tbl[2], sum(tbl[2], tbl[4]), + conf.level = 0.90, method = "waldcc" +) } } diff --git a/man/g_lineplot.Rd b/man/g_lineplot.Rd index 0f41764420..1046bc1496 100644 --- a/man/g_lineplot.Rd +++ b/man/g_lineplot.Rd @@ -144,8 +144,9 @@ Line plot with the optional table \examples{ library(nestcolor) -adsl <- scda::synthetic_cdisc_data("latest")$adsl -adlb <- scda::synthetic_cdisc_data("latest")$adlb +cached_data <- scda::synthetic_cdisc_data("latest") +adsl <- cached_data$adsl +adlb <- cached_data$adlb adlb <- dplyr::filter(adlb, ANL01FL == "Y", PARAMCD == "ALT", AVISIT != "SCREENING") adlb$AVISIT <- droplevels(adlb$AVISIT) adlb <- dplyr::mutate(adlb, AVISIT = forcats::fct_reorder(AVISIT, AVISITN, min)) diff --git a/man/summarize_ancova.Rd b/man/summarize_ancova.Rd index 8be3a481c3..bdb9225de0 100644 --- a/man/summarize_ancova.Rd +++ b/man/summarize_ancova.Rd @@ -164,12 +164,20 @@ conf_level <- 0.95 # Internal function - s_ancova \dontrun{ -s_ancova(df, .var, .df_row, variables, .ref_group, .in_ref_col = FALSE, conf_level, interaction_y = FALSE, interaction_item = NULL) +s_ancova( + df, .var, .df_row, variables, .ref_group, + .in_ref_col = FALSE, + conf_level, interaction_y = FALSE, interaction_item = NULL +) } # Internal function - a_ancova \dontrun{ -a_ancova(df, .var, .df_row, variables, .ref_group, .in_ref_col = FALSE, interaction_y = FALSE, interaction_item = NULL, conf_level) +a_ancova( + df, .var, .df_row, variables, .ref_group, + .in_ref_col = FALSE, + interaction_y = FALSE, interaction_item = NULL, conf_level +) } @@ -177,8 +185,10 @@ library(scda) library(rtables) library(dplyr) -adsl <- synthetic_cdisc_data("rcd_2022_02_28")$adsl -adqs <- synthetic_cdisc_data("rcd_2022_02_28")$adqs +cached_data <- synthetic_cdisc_data("rcd_2022_02_28") + +adsl <- cached_data$adsl +adqs <- cached_data$adqs adqs_single <- adqs \%>\% filter( AVISIT == "WEEK 1 DAY 8", # single time point @@ -207,8 +217,9 @@ basic_table() \%>\% build_table(adqs_single, alt_counts_df = adsl) # Another example: count the interaction between rows and columns into consideration -adsl <- synthetic_cdisc_data("rcd_2022_02_28")$adsl -adqs <- synthetic_cdisc_data("rcd_2022_02_28")$adqs + +adsl <- cached_data$adsl +adqs <- cached_data$adqs adqs_single <- adqs \%>\% filter(AVISIT \%in\% c("WEEK 1 DAY 8", "WEEK 2 DAY 15", "WEEK 5 DAY 36")) \%>\% droplevels() \%>\% diff --git a/vignettes/tern.Rmd b/vignettes/tern.Rmd index 2563b697a8..60dbd8effd 100644 --- a/vignettes/tern.Rmd +++ b/vignettes/tern.Rmd @@ -179,4 +179,4 @@ The [`teal` package](https://insightsengineering.github.io/teal/) is a shiny-bas In summary, `tern` contains many additional functions for creating tables, listing and graphs used in clinical trials and other statistical analyses. The design of the package gives users a lot of flexibility to meet the analysis needs in a regulatory or exploratory reporting context. -**For more information please explore [the tern website](https://insightsengineering.github.io/tern).** +**For more information please explore [the tern website](https://insightsengineering.github.io/tern/).**