diff --git a/.Rbuildignore b/.Rbuildignore index e874f6ab..df658127 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -42,3 +42,12 @@ SECURITY.md ^LICENSE\.md$ coverage.* ^\.pre-commit-config\.yaml +_pkgdown.yml +staged_dependencies.yaml +data-raw/data.R +.gitlab-ci.yml +.lintr +.pre-commit-config.yaml +.github +^.*\.Rproj$ +^\.Rproj\.user$ diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 5031cbce..b3dc9dc3 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -34,6 +34,7 @@ jobs: with: additional-env-vars: | _R_CHECK_CRAN_INCOMING_REMOTE_=false + _R_CHECK_EXAMPLE_TIMING_THRESHOLD_=10 additional-r-cmd-check-params: --as-cran enforce-note-blocklist: true note-blocklist: | diff --git a/DESCRIPTION b/DESCRIPTION index 67162aa1..5d242e76 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,15 +43,10 @@ Suggests: knitr, nestcolor (>= 0.1.0), rmarkdown, - scda (>= 0.1.5), - scda.2022 (>= 0.1.3), testthat (>= 2.0), tidyr VignetteBuilder: knitr -Remotes: - insightsengineering/scda.2022@*release, - insightsengineering/scda@*release Config/Needs/website: insightsengineering/nesttemplate Encoding: UTF-8 Language: en-US diff --git a/NEWS.md b/NEWS.md index e4d86acc..de27311a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,9 @@ # goshawk 0.1.14.9010 -# Examples now use `scda.2022` data instead of `scda.2021`. - ### Miscellaneous * Deprecated `g_scatterplot`. Use `g_correlationplot` instead. +* Removed `scda` package dependency from examples. # goshawk 0.1.14 diff --git a/R/data.R b/R/data.R new file mode 100644 index 00000000..342fd3ed --- /dev/null +++ b/R/data.R @@ -0,0 +1,25 @@ +#' Random lab analysis +#' +#' @description Random lab analysis +#' @docType data +#' +#' @usage rADLB +#' +#' @keywords datasets internal +#' +#' @source internal +#' @name rADLB +"rADLB" + +#' Random patient listing +#' +#' @description Random patient listing +#' @docType data +#' +#' @keywords datasets internal +#' +#' @usage rADSL +#' +#' @source internal +#' @name rADSL +"rADSL" diff --git a/R/g_boxplot.R b/R/g_boxplot.R index c83d858e..c3b687e5 100755 --- a/R/g_boxplot.R +++ b/R/g_boxplot.R @@ -51,13 +51,11 @@ #' #' @examples #' -#' #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(nestcolor) #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADLB <- goshawk::rADLB #' var_labels <- lapply(ADLB, function(x) attributes(x)$label) #' ADLB <- ADLB %>% #' mutate(AVISITCD = case_when( @@ -263,7 +261,7 @@ g_boxplot <- function(data, # Add facetting. if (!is.null(facet_var)) { - if (facet_var != "None" & facet_var %in% names(data)) { + if (facet_var != "None" & facet_var %in% names(data)) { # nolint if (!is_finite(facet_ncol)) facet_ncol <- 0 if (facet_ncol >= 1) { plot1 <- plot1 + diff --git a/R/g_correlationplot.R b/R/g_correlationplot.R index f1873e35..366784da 100644 --- a/R/g_correlationplot.R +++ b/R/g_correlationplot.R @@ -61,7 +61,6 @@ #' @examples #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(stringr) #' library(tidyr) #' @@ -75,7 +74,7 @@ #' # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA" #' shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0) #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADLB <- goshawk::rADLB #' var_labels <- lapply(ADLB, function(x) attributes(x)$label) #' ADLB <- ADLB %>% #' mutate(AVISITCD = case_when( diff --git a/R/g_density_distribution_plot.R b/R/g_density_distribution_plot.R index 484397d2..09183763 100644 --- a/R/g_density_distribution_plot.R +++ b/R/g_density_distribution_plot.R @@ -38,7 +38,6 @@ #' #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(stringr) #' #' # original ARM value = dose value @@ -47,7 +46,7 @@ #' ) #' color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C") #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADLB <- goshawk::rADLB #' var_labels <- lapply(ADLB, function(x) attributes(x)$label) #' ADLB <- ADLB %>% #' mutate(AVISITCD = case_when( diff --git a/R/g_lineplot.R b/R/g_lineplot.R index aac8d172..30211d0a 100644 --- a/R/g_lineplot.R +++ b/R/g_lineplot.R @@ -53,7 +53,6 @@ #' #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(stringr) #' library(dplyr) #' library(nestcolor) @@ -65,9 +64,8 @@ #' color_manual <- c("150mg QD" = "thistle", "Placebo" = "orange", "Combination" = "steelblue") #' type_manual <- c("150mg QD" = "solid", "Placebo" = "dashed", "Combination" = "dotted") #' -#' ADSL <- synthetic_cdisc_data("latest")$adsl %>% -#' filter(!(ARM == "B: Placebo" & AGE < 40)) -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADSL <- goshawk::rADSL %>% filter(!(ARM == "B: Placebo" & AGE < 40)) +#' ADLB <- goshawk::rADLB #' ADLB <- right_join(ADLB, ADSL[, c("STUDYID", "USUBJID")]) #' var_labels <- lapply(ADLB, function(x) attributes(x)$label) #' diff --git a/R/g_scatterplot.R b/R/g_scatterplot.R index 40a5698e..a3f6f6fe 100644 --- a/R/g_scatterplot.R +++ b/R/g_scatterplot.R @@ -45,7 +45,6 @@ #' @examples #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(stringr) #' #' # original ARM value = dose value @@ -56,7 +55,7 @@ #' # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA" #' shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0) #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADLB <- goshawk::rADLB #' var_labels <- lapply(ADLB, function(x) attributes(x)$label) #' ADLB <- ADLB %>% #' mutate(AVISITCD = case_when( diff --git a/R/g_spaghettiplot.R b/R/g_spaghettiplot.R index 44ba86f2..ee0d0d54 100644 --- a/R/g_spaghettiplot.R +++ b/R/g_spaghettiplot.R @@ -47,7 +47,6 @@ #' #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(stringr) #' #' # original ARM value = dose value @@ -56,7 +55,7 @@ #' ) #' color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C") #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADLB <- goshawk::rADLB #' var_labels <- lapply(ADLB, function(x) attributes(x)$label) #' ADLB <- ADLB %>% #' mutate(AVISITCD = case_when( diff --git a/R/t_summarytable.R b/R/t_summarytable.R index 1f4c4e6f..5f0a8dd2 100644 --- a/R/t_summarytable.R +++ b/R/t_summarytable.R @@ -25,7 +25,6 @@ #' @examples #' # Example using ADaM structure analysis dataset. #' -#' library(scda) #' library(stringr) #' #' # original ARM value = dose value @@ -33,7 +32,7 @@ #' "A: Drug X" = "150mg QD", "B: Placebo" = "Placebo", "C: Combination" = "Combination" #' ) #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb +#' ADLB <- goshawk::rADLB #' ADLB <- ADLB %>% #' mutate(AVISITCD = case_when( #' AVISIT == "SCREENING" ~ "SCR", diff --git a/R/utils.R b/R/utils.R index 36a1d486..1de81c24 100644 --- a/R/utils.R +++ b/R/utils.R @@ -12,11 +12,8 @@ #' @keywords internal #' #' @examples -#' library(scda) #' -#' ADLB <- synthetic_cdisc_data("latest")$adlb -#' -#' goshawk:::h_identify_loq_values(loqs_data = ADLB) +#' goshawk:::h_identify_loq_values(loqs_data = goshawk::rADLB) h_identify_loq_values <- function(loqs_data) { ifelse( !grep("PARAM", names(loqs_data)), @@ -79,9 +76,7 @@ h_identify_loq_values <- function(loqs_data) { #' @keywords internal #' #' @examples -#' library(scda) -#' ADLB <- synthetic_cdisc_data("latest")$adlb -#' caption_label <- goshawk:::h_caption_loqs_label(loqs_data = ADLB) +#' caption_label <- goshawk:::h_caption_loqs_label(loqs_data = goshawk::rADLB) h_caption_loqs_label <- function(loqs_data) { loq_values <- h_identify_loq_values(loqs_data) diff --git a/data-raw/data.R b/data-raw/data.R new file mode 100644 index 00000000..eff63b5c --- /dev/null +++ b/data-raw/data.R @@ -0,0 +1,6 @@ +library(scda) +rADLB <- synthetic_cdisc_data("latest")$adlb # nolint +usethis::use_data(rADLB) + +rADSL <- synthetic_cdisc_data("latest")$adsl # nolint +usethis::use_data(rADSL) diff --git a/data/rADLB.rda b/data/rADLB.rda new file mode 100644 index 00000000..ce65883e Binary files /dev/null and b/data/rADLB.rda differ diff --git a/data/rADSL.rda b/data/rADSL.rda new file mode 100644 index 00000000..53ad350e Binary files /dev/null and b/data/rADSL.rda differ diff --git a/man/g_boxplot.Rd b/man/g_boxplot.Rd index 3c3cb8b9..4160a3e1 100644 --- a/man/g_boxplot.Rd +++ b/man/g_boxplot.Rd @@ -105,13 +105,11 @@ midhinge, range, mid-range, and trimean. } \examples{ - # Example using ADaM structure analysis dataset. -library(scda) library(nestcolor) -ADLB <- synthetic_cdisc_data("latest")$adlb +ADLB <- goshawk::rADLB var_labels <- lapply(ADLB, function(x) attributes(x)$label) ADLB <- ADLB \%>\% mutate(AVISITCD = case_when( diff --git a/man/g_correlationplot.Rd b/man/g_correlationplot.Rd index 232c6fdf..7f3df3de 100644 --- a/man/g_correlationplot.Rd +++ b/man/g_correlationplot.Rd @@ -149,7 +149,6 @@ Regression uses deming model. \examples{ # Example using ADaM structure analysis dataset. -library(scda) library(stringr) library(tidyr) @@ -163,7 +162,7 @@ color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA" shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0) -ADLB <- synthetic_cdisc_data("latest")$adlb +ADLB <- goshawk::rADLB var_labels <- lapply(ADLB, function(x) attributes(x)$label) ADLB <- ADLB \%>\% mutate(AVISITCD = case_when( diff --git a/man/g_density_distribution_plot.Rd b/man/g_density_distribution_plot.Rd index 720c1a7e..4d3f3fa0 100644 --- a/man/g_density_distribution_plot.Rd +++ b/man/g_density_distribution_plot.Rd @@ -83,7 +83,6 @@ treatment overlaid. # Example using ADaM structure analysis dataset. -library(scda) library(stringr) # original ARM value = dose value @@ -92,7 +91,7 @@ arm_mapping <- list( ) color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C") -ADLB <- synthetic_cdisc_data("latest")$adlb +ADLB <- goshawk::rADLB var_labels <- lapply(ADLB, function(x) attributes(x)$label) ADLB <- ADLB \%>\% mutate(AVISITCD = case_when( diff --git a/man/g_lineplot.Rd b/man/g_lineplot.Rd index f238973e..89eefd9d 100644 --- a/man/g_lineplot.Rd +++ b/man/g_lineplot.Rd @@ -117,7 +117,6 @@ quartile. # Example using ADaM structure analysis dataset. -library(scda) library(stringr) library(dplyr) library(nestcolor) @@ -129,9 +128,8 @@ arm_mapping <- list( color_manual <- c("150mg QD" = "thistle", "Placebo" = "orange", "Combination" = "steelblue") type_manual <- c("150mg QD" = "solid", "Placebo" = "dashed", "Combination" = "dotted") -ADSL <- synthetic_cdisc_data("latest")$adsl \%>\% - filter(!(ARM == "B: Placebo" & AGE < 40)) -ADLB <- synthetic_cdisc_data("latest")$adlb +ADSL <- goshawk::rADSL \%>\% filter(!(ARM == "B: Placebo" & AGE < 40)) +ADLB <- goshawk::rADLB ADLB <- right_join(ADLB, ADSL[, c("STUDYID", "USUBJID")]) var_labels <- lapply(ADLB, function(x) attributes(x)$label) diff --git a/man/g_scatterplot.Rd b/man/g_scatterplot.Rd index 2ed3cc2d..db1b6d9a 100644 --- a/man/g_scatterplot.Rd +++ b/man/g_scatterplot.Rd @@ -96,7 +96,6 @@ Regression uses deming model. \examples{ # Example using ADaM structure analysis dataset. -library(scda) library(stringr) # original ARM value = dose value @@ -107,7 +106,7 @@ color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = # assign LOQ flag symbols: circles for "N" and triangles for "Y", squares for "NA" shape_manual <- c("N" = 1, "Y" = 2, "NA" = 0) -ADLB <- synthetic_cdisc_data("latest")$adlb +ADLB <- goshawk::rADLB var_labels <- lapply(ADLB, function(x) attributes(x)$label) ADLB <- ADLB \%>\% mutate(AVISITCD = case_when( diff --git a/man/g_spaghettiplot.Rd b/man/g_spaghettiplot.Rd index c7df042f..51c19389 100644 --- a/man/g_spaghettiplot.Rd +++ b/man/g_spaghettiplot.Rd @@ -105,7 +105,6 @@ This function is rendered by teal.goshawk module # Example using ADaM structure analysis dataset. -library(scda) library(stringr) # original ARM value = dose value @@ -114,7 +113,7 @@ arm_mapping <- list( ) color_manual <- c("150mg QD" = "#000000", "Placebo" = "#3498DB", "Combination" = "#E74C3C") -ADLB <- synthetic_cdisc_data("latest")$adlb +ADLB <- goshawk::rADLB var_labels <- lapply(ADLB, function(x) attributes(x)$label) ADLB <- ADLB \%>\% mutate(AVISITCD = case_when( diff --git a/man/h_caption_loqs_label.Rd b/man/h_caption_loqs_label.Rd index 51d7ca5b..54e863f5 100644 --- a/man/h_caption_loqs_label.Rd +++ b/man/h_caption_loqs_label.Rd @@ -13,8 +13,6 @@ h_caption_loqs_label(loqs_data) Add footnote to identify LLOQ and ULOQ values identified from data } \examples{ -library(scda) -ADLB <- synthetic_cdisc_data("latest")$adlb -caption_label <- goshawk:::h_caption_loqs_label(loqs_data = ADLB) +caption_label <- goshawk:::h_caption_loqs_label(loqs_data = goshawk::rADLB) } \keyword{internal} diff --git a/man/h_identify_loq_values.Rd b/man/h_identify_loq_values.Rd index 2f16b357..2a1e6d2a 100644 --- a/man/h_identify_loq_values.Rd +++ b/man/h_identify_loq_values.Rd @@ -22,10 +22,7 @@ reference in the visualizations. This also aids in setting the data constraint ranges when goshawk functions are run from teal.goshawk UI. } \examples{ -library(scda) -ADLB <- synthetic_cdisc_data("latest")$adlb - -goshawk:::h_identify_loq_values(loqs_data = ADLB) +goshawk:::h_identify_loq_values(loqs_data = goshawk::rADLB) } \keyword{internal} diff --git a/man/rADLB.Rd b/man/rADLB.Rd new file mode 100644 index 00000000..a5430d32 --- /dev/null +++ b/man/rADLB.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{rADLB} +\alias{rADLB} +\title{Random lab analysis} +\format{ +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 8400 rows and 102 columns. +} +\source{ +internal +} +\usage{ +rADLB +} +\description{ +Random lab analysis +} +\keyword{datasets} +\keyword{internal} diff --git a/man/rADSL.Rd b/man/rADSL.Rd new file mode 100644 index 00000000..1b09ee22 --- /dev/null +++ b/man/rADSL.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{rADSL} +\alias{rADSL} +\title{Random patient listing} +\format{ +An object of class \code{tbl_df} (inherits from \code{tbl}, \code{data.frame}) with 400 rows and 55 columns. +} +\source{ +internal +} +\usage{ +rADSL +} +\description{ +Random patient listing +} +\keyword{datasets} +\keyword{internal} diff --git a/man/t_summarytable.Rd b/man/t_summarytable.Rd index fa6f415b..8e2b2ee0 100644 --- a/man/t_summarytable.Rd +++ b/man/t_summarytable.Rd @@ -45,7 +45,6 @@ provide additional information as needed. link to specification file \examples{ # Example using ADaM structure analysis dataset. -library(scda) library(stringr) # original ARM value = dose value @@ -53,7 +52,7 @@ arm_mapping <- list( "A: Drug X" = "150mg QD", "B: Placebo" = "Placebo", "C: Combination" = "Combination" ) -ADLB <- synthetic_cdisc_data("latest")$adlb +ADLB <- goshawk::rADLB ADLB <- ADLB \%>\% mutate(AVISITCD = case_when( AVISIT == "SCREENING" ~ "SCR", diff --git a/staged_dependencies.yaml b/staged_dependencies.yaml index b7a8b271..9d1ae15d 100644 --- a/staged_dependencies.yaml +++ b/staged_dependencies.yaml @@ -1,3 +1,4 @@ +--- current_repo: repo: insightsengineering/goshawk host: https://github.com @@ -5,12 +6,6 @@ upstream_repos: insightsengineering/nestcolor: repo: insightsengineering/nestcolor host: https://github.com - insightsengineering/scda: - repo: insightsengineering/scda - host: https://github.com - insightsengineering/scda.2022: - repo: insightsengineering/scda.2022 - host: https://github.com downstream_repos: insightsengineering/teal.goshawk: repo: insightsengineering/teal.goshawk