aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_nlme.R
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testthat/test_nlme.R')
-rw-r--r--tests/testthat/test_nlme.R12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/testthat/test_nlme.R b/tests/testthat/test_nlme.R
index e5e19c60..31fb19de 100644
--- a/tests/testthat/test_nlme.R
+++ b/tests/testthat/test_nlme.R
@@ -2,20 +2,21 @@ context("Nonlinear mixed-effects models")
library(nlme)
+sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
+
test_that("nlme_function works correctly", {
- sampling_times = c(0, 1, 3, 7, 14, 28, 60, 90, 120)
m_SFO <- mkinmod(parent = mkinsub("SFO"))
d_SFO_1 <- mkinpredict(m_SFO,
- c(k_parent_sink = 0.1),
+ c(k_parent = 0.1),
c(parent = 98), sampling_times)
d_SFO_1_long <- mkin_wide_to_long(d_SFO_1, time = "time")
d_SFO_2 <- mkinpredict(m_SFO,
- c(k_parent_sink = 0.05),
+ c(k_parent = 0.05),
c(parent = 102), sampling_times)
d_SFO_2_long <- mkin_wide_to_long(d_SFO_2, time = "time")
d_SFO_3 <- mkinpredict(m_SFO,
- c(k_parent_sink = 0.02),
+ c(k_parent = 0.02),
c(parent = 103), sampling_times)
d_SFO_3_long <- mkin_wide_to_long(d_SFO_3, time = "time")
@@ -33,7 +34,6 @@ test_that("nlme_function works correctly", {
# The following assignment was introduced for nlme as evaluated by testthat
# to find the function
assign("nlme_f", nlme_f, pos = globalenv())
- assign("sampling_times", sampling_times, pos = globalenv())
m_nlme_raw <- nlme(value ~ SSasymp(time, 0, parent_0, log_k_parent_sink),
data = grouped_data,
@@ -101,7 +101,7 @@ test_that("nlme_function works correctly in other cases", {
SFO <- mkinmod(parent = mkinsub("SFO"))
pred_sfo <- function(k) {
mkinpredict(SFO,
- c(k_parent_sink = k),
+ c(k_parent = k),
c(parent = 100),
sampling_times)
}

Contact - Imprint