diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2019-02-27 12:04:52 +0100 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2019-02-27 12:04:52 +0100 |
commit | 6b4ab746e5474dfeda9237f01bc2dd01f1bb62ee (patch) | |
tree | 7299e1fa4fa9bd0090a5878df985312f528615f4 /tests/testthat/test_from_max_mean.R | |
parent | c446b59e675aeff08ff7205b05f06cd81bf6dc68 (diff) |
Increase test coverage
Diffstat (limited to 'tests/testthat/test_from_max_mean.R')
-rw-r--r-- | tests/testthat/test_from_max_mean.R | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testthat/test_from_max_mean.R b/tests/testthat/test_from_max_mean.R new file mode 100644 index 00000000..8e5953b9 --- /dev/null +++ b/tests/testthat/test_from_max_mean.R @@ -0,0 +1,17 @@ +context("Test fitting the decline of metabolites from their maximum") + +test_that("Fitting from maximum mean value works", { + SFO_SFO <- mkinmod(parent = mkinsub("SFO", "m1"), + m1 = mkinsub("SFO")) + expect_error(mkinfit(SFO_SFO, FOCUS_2006_D, from_max_mean = TRUE)) + + # We can either explicitly create a model for m1, or subset the data + SFO_m1 <- mkinmod(m1 = mkinsub("SFO")) + f.1 <- mkinfit(SFO_m1, FOCUS_2006_D, from_max_mean = TRUE, quiet = TRUE) + expect_equivalent(endpoints(f.1)$distimes["m1", ], c(170.8, 567.5), + scale = 1, tolerance = 0.1) + + f.2 <- mkinfit("SFO", subset(FOCUS_2006_D, name == "m1"), from_max_mean = TRUE, quiet = TRUE) + expect_equivalent(endpoints(f.2)$distimes["m1", ], c(170.8, 567.5), + scale = 1, tolerance = 0.1) +}) |