Skip to content

Commit

Permalink
Decouple scda (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Jul 6, 2023
1 parent 30dd797 commit b6de623
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=10
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=5
additional-r-cmd-check-params: --as-cran
enforce-note-blocklist: true
note-blocklist: |
Expand Down
6 changes: 1 addition & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Imports:
lifecycle,
logger (>= 0.2.0),
shinyvalidate,
teal.code (>= 0.2.0),
teal.code (>= 0.3.0),
teal.logger (>= 0.1.1),
teal.reporter (>= 0.1.1),
teal.transform (>= 0.3.0),
Expand All @@ -43,15 +43,11 @@ Suggests:
knitr,
nestcolor (>= 0.1.0),
rmarkdown,
scda (>= 0.1.5),
scda.2022 (>= 0.1.3),
teal.data (>= 0.1.2),
testthat (>= 2.0)
Remotes:
insightsengineering/osprey@*release,
insightsengineering/osprey@*release,
insightsengineering/scda.2022@*release,
insightsengineering/scda@*release,
insightsengineering/teal.code@*release,
insightsengineering/teal.data@*release,
insightsengineering/teal.logger@*release,
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# teal.osprey 0.1.15.9013

* Examples now use `scda.2022` instead of `scda.2021`.
* Removed `scda` package dependency from examples.
* Fixed crash in `tm_g_heat_bygrade` when not plotting `Conmed`.
* Added validation to `tm_g_spiderplot.R` that checks if there are duplicates in X and Y facet variables.
* Improved input validation and used the `teal::validate_inputs` mechanism to send validation messages to the output panel.
Expand All @@ -10,7 +10,7 @@
### Breaking changes

* Replaced `chunks` with simpler `qenv` class.
* Replaced `datasets` argument containing `FilteredData` with the new arguments `data` (`tdata` object) and `filter_panel_api` (`FilterPanelAPI`).
* In all `tm_xyz_srv` modules `datasets` argument containing `FilteredData` have been replaced with the new argument `data` (`tdata` object) and `filter_panel_api` (`FilterPanelAPI`).
* Updated `arm_var` to point to the factor column in `ANL`. It can't be a character column anymore.
* Removed redundant formal arguments from `tm_g_patient_profile`.

Expand Down
10 changes: 4 additions & 6 deletions R/tm_g_ae_oview.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
#' @export
#'
#' @examples
#' library(scda)
#' library(nestcolor)
#'
#' latest_data <- synthetic_cdisc_data("latest")
#' ADSL <- latest_data$adsl
#' ADAE <- latest_data$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#'
#' # Add additional dummy causality flags.
#' add_event_flags <- function(dat) {
Expand All @@ -47,10 +45,10 @@
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADAE", ADAE,
#' code =
#' "ADAE <- synthetic_cdisc_data('latest')$adae
#' "ADAE <- osprey::rADAE
#' add_event_flags <- function(dat) {
#' dat <- dat %>%
#' dplyr::mutate(
Expand Down
10 changes: 4 additions & 6 deletions R/tm_g_ae_sub.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
#'
#' @examples
#' # Example using stream (ADaM) dataset
#' library(scda)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"),
#' check = TRUE
#' ),
#' modules = modules(
Expand Down
9 changes: 4 additions & 5 deletions R/tm_g_butterfly.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@
#'
#' # Example using stream (ADaM) dataset
#' library(dplyr)
#' library(scda)
#' library(nestcolor)
#'
#' set.seed(23)
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#' ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), "UG"))
#' ADAE <- mutate(
#' ADAE,
Expand All @@ -61,12 +60,12 @@
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL,
#' code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl
#' code = "ADSL <- osprey::rADSL
#' set.seed(23)
#' ADSL <- mutate(ADSL, DOSE = paste(sample(1:3, n(), replace = TRUE), 'UG'))"
#' ),
#' cdisc_dataset("ADAE", ADAE,
#' code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae
#' code = "ADAE <- osprey::rADAE
#' ADAE <- mutate(ADAE,
#' flag1 = ifelse(AETOXGR == 1, 1, 0),
#' flag2 = ifelse(AETOXGR == 2, 1, 0),
Expand Down
9 changes: 4 additions & 5 deletions R/tm_g_events_term_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@
#' @author Molly He (hey59) \email{hey59@gene.com}
#'
#' @examples
#' library(scda)
#' library(nestcolor)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADAE <- synthetic_cdisc_data("latest")$adae
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADAE", ADAE, code = "ADAE <- osprey::rADAE"),
#' check = TRUE
#' ),
#' modules = modules(
Expand Down
19 changes: 8 additions & 11 deletions R/tm_g_heat_bygrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@
#' @export
#'
#' @examples
#' library(scda)
#' library(dplyr)
#' library(nestcolor)
#' latest_data <- synthetic_cdisc_data("latest")
#' ADSL <- latest_data$adsl %>% slice(1:30)
#' ADEX <- latest_data$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- latest_data$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- latest_data$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADSL <- osprey::rADSL %>% slice(1:30)
#' ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID)
#'
#' # This preprocess is only to force legacy standard on ADCM
#' ADCM <- ADCM %>%
Expand Down Expand Up @@ -80,11 +78,10 @@
#' cdisc_dataset("ADAE", ADAE),
#' cdisc_dataset("ADCM", ADCM, keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")),
#' code = "
#' latest_data <- synthetic_cdisc_data('latest')
#' ADSL <- latest_data$adsl %>% slice(1:30)
#' ADEX <- latest_data$adex %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- latest_data$adae %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- latest_data$adcm %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADSL <- osprey::rADSL %>% slice(1:30)
#' ADEX <- osprey::rADEX %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADAE <- osprey::rADAE %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- osprey::rADCM %>% filter(USUBJID %in% ADSL$USUBJID)
#' ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()
#' ADEX <- ADEX %>%
#' filter(PARCAT1 == 'INDIVIDUAL') %>%
Expand Down
32 changes: 12 additions & 20 deletions R/tm_g_patient_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,15 @@
#' @export
#'
#' @examples
#' library(scda)
#' library(nestcolor)
#'
#' latest_data <- synthetic_cdisc_data("latest")
#'
#' ADSL <- latest_data$adsl
#' ADAE <- latest_data$adae %>%
#' ADSL <- osprey::rADSL
#' ADAE <- osprey::rADAE %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
#' )
#' ADCM <- latest_data$adcm %>%
#' ADCM <- osprey::rADCM %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
Expand All @@ -84,47 +81,42 @@
#' select(-starts_with("ATC")) %>%
#' unique()
#'
#' ADRS <- latest_data$adrs %>%
#' ADRS <- osprey::rADRS %>%
#' mutate(ADT = as.Date(ADTM))
#' ADEX <- latest_data$adex %>%
#' ADEX <- osprey::rADEX %>%
#' mutate(
#' ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM)
#' )
#' ADLB <- latest_data$adlb %>%
#' ADLB <- osprey::rADLB %>%
#' mutate(
#' ADT = as.Date(ADTM),
#' LBSTRESN = as.numeric(LBSTRESC)
#' )
#'
#' app <- init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL,
#' code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"
#' ),
#' cdisc_dataset("ADRS", ADRS,
#' code = "ADRS <- synthetic_cdisc_data(\"latest\")$adrs %>%
#' mutate(ADT = as.Date(ADTM))"
#' ),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADRS", ADRS, code = "ADRS <- osprey::rADRS %>% mutate(ADT = as.Date(ADTM))"),
#' cdisc_dataset("ADAE", ADAE,
#' code = "ADAE <- synthetic_cdisc_data(\"latest\")$adae %>%
#' code = "ADAE <- osprey::rADAE %>%
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))"
#' ),
#' cdisc_dataset("ADCM", ADCM,
#' code = "ADCM <- synthetic_cdisc_data(\"latest\")$adcm %>%
#' code = "ADCM <- osprey::rADCM %>%
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))
#' ADCM <- ADCM %>% select(-starts_with(\"ATC\")) %>% unique()",
#' keys = c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "CMDECOD")
#' ),
#' cdisc_dataset("ADLB", ADLB,
#' code = "ADLB <- synthetic_cdisc_data(\"latest\")$adlb %>%
#' code = "ADLB <- osprey::rADLB %>%
#' mutate(ADT = as.Date(ADTM),
#' LBSTRESN = as.numeric(LBSTRESC))"
#' ),
#' cdisc_dataset("ADEX", ADEX,
#' code = "ADEX <- synthetic_cdisc_data(\"latest\")$adex %>%
#' code = "ADEX <- osprey::rADEX %>%
#' mutate(ASTDT = as.Date(ASTDTM),
#' AENDT = as.Date(AENDTM))"
#' ),
Expand Down
9 changes: 4 additions & 5 deletions R/tm_g_spiderplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@
#'
#' # Example using stream (ADaM) dataset
#' library(dplyr)
#' library(scda)
#' library(nestcolor)
#'
#' ADSL <- synthetic_cdisc_data("latest")$adsl
#' ADTR <- synthetic_cdisc_data("latest")$adtr
#' ADSL <- osprey::rADSL
#' ADTR <- osprey::rADTR
#'
#' app <- teal::init(
#' data = cdisc_data(
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
#' cdisc_dataset("ADSL", ADSL, code = "ADSL <- osprey::rADSL"),
#' cdisc_dataset("ADTR", ADTR,
#' code = "ADTR <- synthetic_cdisc_data(\"latest\")$adtr",
#' code = "ADTR <- osprey::rADTR",
#' keys = c("STUDYID", "USUBJID", "PARAMCD", "AVISIT")
#' ),
#' check = TRUE
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ remotes::install_github("insightsengineering/teal.osprey@*release")

A stable release of all `NEST` packages from June 2022 is also available [here](https://github.com/insightsengineering/depository#readme).

In order to run many of the examples you will also need to install the [`scda`](https://insightsengineering.github.io/scda/) package.

## Stargazers and Forkers

### Stargazers over time
Expand Down
10 changes: 4 additions & 6 deletions man/tm_g_ae_oview.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions man/tm_g_ae_sub.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions man/tm_g_butterfly.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions man/tm_g_events_term_id.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b6de623

Please sign in to comment.