Skip to content

Commit

Permalink
87 remove datasets - decrease package size (#228)
Browse files Browse the repository at this point in the history
In the spirit of package size reduction
insightsengineering/nestdevs-tasks#87
I replaced all the calls for tmg datasets with their respective datasets
from teal.data.
This way we no longer need to have datasets copies in tmg.
  • Loading branch information
m7pr authored Dec 13, 2024
1 parent 5a5349b commit f0b28e0
Show file tree
Hide file tree
Showing 35 changed files with 42 additions and 222 deletions.
5 changes: 2 additions & 3 deletions R/choices_labeled.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#' @return Named `character` vector.
#'
#' @examples
#' library(shiny)
#' library(teal.data)
#' library(shiny)
#'
#' ADSL <- rADSL
#' ADTTE <- rADTTE
Expand Down Expand Up @@ -151,7 +151,6 @@ choices_labeled <- function(choices, labels, subset = NULL, types = NULL) {
#'
#' @examples
#' library(teal.data)
#'
#' ADRS <- rADRS
#' variable_choices(ADRS)
#' variable_choices(ADRS, subset = c("PARAM", "PARAMCD"))
Expand Down Expand Up @@ -267,7 +266,7 @@ variable_choices.data.frame <- function(data, subset = NULL, fill = TRUE, key =
#' @return named character vector or `delayed_data` object.
#'
#' @examples
#' ADRS <- rADRS
#' ADRS <- teal.data::rADRS
#' value_choices(ADRS, "PARAMCD", "PARAM", subset = c("BESRSPI", "INVET"))
#' value_choices(ADRS, c("PARAMCD", "ARMCD"), c("PARAM", "ARM"))
#' value_choices(ADRS, c("PARAMCD", "ARMCD"), c("PARAM", "ARM"),
Expand Down
2 changes: 1 addition & 1 deletion R/choices_selected.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ no_select_keyword <- "-- no selection --"
#' selected = "C"
#' )
#'
#' ADSL <- rADSL
#' ADSL <- teal.data::rADSL
#' choices_selected(variable_choices(ADSL), "SEX")
#'
#' # How to select nothing
Expand Down
59 changes: 0 additions & 59 deletions R/data.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/resolve_delayed.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @examples
#' library(shiny)
#'
#' ADSL <- rADSL
#' ADSL <- teal.data::rADSL
#' isolate({
#' data_list <- list(ADSL = reactive(ADSL))
#'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Below is a small example usage:

```r
library(teal.transform)
ADSL <- rADSL
ADSL <- teal.data::rADSL

adsl_extract <- data_extract_spec(
dataname = "ADSL",
Expand Down
19 changes: 0 additions & 19 deletions data-raw/data.R

This file was deleted.

Binary file removed data/rADAE.rda
Binary file not shown.
Binary file removed data/rADLB.rda
Binary file not shown.
Binary file removed data/rADRS.rda
Binary file not shown.
Binary file removed data/rADSL.rda
Binary file not shown.
Binary file removed data/rADTTE.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion man/choices_labeled.Rd

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

2 changes: 1 addition & 1 deletion man/choices_selected.Rd

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

20 changes: 0 additions & 20 deletions man/rADAE.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADLB.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADRS.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADSL.Rd

This file was deleted.

20 changes: 0 additions & 20 deletions man/rADTTE.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/resolve_delayed.Rd

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

2 changes: 1 addition & 1 deletion man/value_choices.Rd

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

1 change: 0 additions & 1 deletion man/variable_choices.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat/test-data_extract_module.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADLB <- rADLB
ADTTE <- rADTTE
ADLB <- teal.data::rADLB
ADTTE <- teal.data::rADTTE

testthat::test_that("Single filter", {
data_extract <- data_extract_spec(
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-data_extract_multiple_srv.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ADSL <- rADSL
ADLB <- rADLB
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADLB <- teal.data::rADLB
ADTTE <- teal.data::rADTTE

data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE), ADLB = reactive(ADLB))
join_keys <- teal.data::default_cdisc_join_keys[c("ADSL", "ADTTE", "ADLB")]
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-data_extract_spec.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADSL <- rADSL
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADTTE <- teal.data::rADTTE
data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE))
key_list <- list(ADSL = c("STUDYID", "USUBJID"), ADTTE = c("STUDYID", "USUBJID", "PARAMCD"))

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-data_extract_srv.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ADSL <- rADSL
ADLB <- rADLB
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADLB <- teal.data::rADLB
ADTTE <- teal.data::rADTTE

data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE), ADLB = reactive(ADLB))
join_keys <- teal.data::default_cdisc_join_keys[c("ADSL", "ADTTE", "ADLB")]
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-delayed_data_extract.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Contains integration tests between delayed data loading objects and
# the objects responsible for loading, pulling and filtering the data
ADSL <- rADSL
ADTTE <- rADTTE
ADAE <- rADAE
ADRS <- rADRS
ADSL <- teal.data::rADSL
ADTTE <- teal.data::rADTTE
ADAE <- teal.data::rADAE
ADRS <- teal.data::rADRS

data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE), ADAE = reactive(ADAE), ADRS = reactive(ADRS))
join_keys <- teal.data::default_cdisc_join_keys[c("ADSL", "ADTTE", "ADAE", "ADRS")]
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-filter_spec.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADSL <- rADSL
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADTTE <- teal.data::rADTTE
data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE), ADLB = reactive(ADLB))
join_keys <- teal.data::default_cdisc_join_keys[c("ADSL", "ADTTE", "ADLB")]
primary_keys_list <- lapply(join_keys, function(x) x[[1]])
Expand Down Expand Up @@ -218,7 +218,7 @@ testthat::test_that("filter_spec_internal", {
})

testthat::test_that("filter_spec_internal contains dataname", {
ADSL <- rADSL
ADSL <- teal.data::rADSL

x_filter <- filter_spec_internal(
vars_choices = variable_choices(ADSL)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-resolve.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADSL <- rADSL
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADTTE <- teal.data::rADTTE

arm_ref_comp <- list(
ARMCD = list(
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-resolve_delayed.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
adsl <- rADSL
adtte <- rADTTE
adsl <- teal.data::rADSL
adtte <- teal.data::rADTTE

data_list <- list(ADSL = reactive(adsl), ADTTE = reactive(adtte))
join_keys <- teal.data::default_cdisc_join_keys[c("ADSL", "ADTTE")]
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-select_spec.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
adsl <- rADSL
adtte <- rADTTE
adsl <- teal.data::rADSL
adtte <- teal.data::rADTTE
data_list <- list(ADSL = reactive(adsl), ADTTE = reactive(adtte))
primary_keys_list <- list(ADSL = c("STUDYID", "USUBJID"), ADTTE = c("STUDYID", "USUBJID", "PARAMCD"))

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-value_choices.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADSL <- rADSL
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADTTE <- teal.data::rADTTE
data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE))
primary_keys_list <- list(ADSL = c("STUDYID", "USUBJID"), ADTTE = c("STUDYID", "USUBJID", "PARAMCD"))

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-variable_choices.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ADSL <- rADSL
ADTTE <- rADTTE
ADSL <- teal.data::rADSL
ADTTE <- teal.data::rADTTE
data_list <- list(ADSL = reactive(ADSL), ADTTE = reactive(ADTTE))
primary_keys_list <- list(ADSL = c("STUDYID", "USUBJID"), ADTTE = c("STUDYID", "USUBJID", "PARAMCD"))

Expand Down
Loading

0 comments on commit f0b28e0

Please sign in to comment.