aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2023-04-15 08:44:51 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2023-04-15 08:44:51 +0200
commitc705a294113ee74a8d408b8b51e4eb2b2822b3a7 (patch)
tree4769c1db159429f1054f35097f366cbbf3dc2cb7 /tests
parentf20a9d81cbcd514ed629b69364cd85a72ac06e95 (diff)
Move preprocessing of DMTA data to the test setup
Diffstat (limited to 'tests')
-rw-r--r--tests/testthat/setup_script.R12
-rw-r--r--tests/testthat/test_dmta.R11
2 files changed, 12 insertions, 11 deletions
diff --git a/tests/testthat/setup_script.R b/tests/testthat/setup_script.R
index 4e2f76ab..b2147fbe 100644
--- a/tests/testthat/setup_script.R
+++ b/tests/testthat/setup_script.R
@@ -110,3 +110,15 @@ dfop_saem_1 <- saem(mmkin_dfop_1, quiet = TRUE, transformations = "mkin",
no_random_effect = c("parent_0", "g_qlogis"))
parallel::stopCluster(cl)
+
+# Preprocess dimethenamid data
+dmta_ds <- lapply(1:7, function(i) {
+ ds_i <- dimethenamid_2018$ds[[i]]$data
+ ds_i[ds_i$name == "DMTAP", "name"] <- "DMTA"
+ ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
+ ds_i
+})
+names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
+dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
+dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
+
diff --git a/tests/testthat/test_dmta.R b/tests/testthat/test_dmta.R
index 825c6e80..cd6de341 100644
--- a/tests/testthat/test_dmta.R
+++ b/tests/testthat/test_dmta.R
@@ -1,16 +1,5 @@
context("Dimethenamid data from 2018")
-# Data
-dmta_ds <- lapply(1:7, function(i) {
- ds_i <- dimethenamid_2018$ds[[i]]$data
- ds_i[ds_i$name == "DMTAP", "name"] <- "DMTA"
- ds_i$time <- ds_i$time * dimethenamid_2018$f_time_norm[i]
- ds_i
-})
-names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
-dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
-dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
-
test_that("Different backends get consistent results for DFOP tc, dimethenamid data", {
skip_on_cran() # Time constraints

Contact - Imprint