aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_from_max_mean.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-04-10 10:17:35 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2019-04-10 10:17:35 +0200
commit194659fcaccdd1ee37851725b8c72e99daa3a8cf (patch)
treeedbbebe8956000b9eb725ca425b91e051571ec02 /tests/testthat/test_from_max_mean.R
parent5814be02f286ce96d6cff8d698aea6844e4025f1 (diff)
Adapt tests, vignettes and examples
- Write the NEWS - Static documentation rebuilt by pkgdown - Adapt mkinerrmin - Fix (hopefully all) remaining problems in mkinfit
Diffstat (limited to 'tests/testthat/test_from_max_mean.R')
-rw-r--r--tests/testthat/test_from_max_mean.R12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/testthat/test_from_max_mean.R b/tests/testthat/test_from_max_mean.R
index 7529c5f2..c4d6bfe4 100644
--- a/tests/testthat/test_from_max_mean.R
+++ b/tests/testthat/test_from_max_mean.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2018 Johannes Ranke
+# Copyright (C) 2018,2019 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package mkin
@@ -21,15 +21,19 @@ 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))
+ expect_warning(
+ expect_error(mkinfit(SFO_SFO, FOCUS_2006_D, from_max_mean = TRUE),
+ "only implemented for models with a single observed variable"),
+ "Observations with value of zero were removed")
# 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)
+ f.1 <- expect_warning(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)
+ f.2 <- expect_warning(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)
})

Contact - Imprint