From 12a31f4c130c551f82232d9ef7dfb608bd52c53f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 27 Sep 2016 23:00:48 +0200 Subject: Reorganise repository using standard package layout --- tests/testthat/test_SFO_actual_twa.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/testthat/test_SFO_actual_twa.R (limited to 'tests/testthat/test_SFO_actual_twa.R') diff --git a/tests/testthat/test_SFO_actual_twa.R b/tests/testthat/test_SFO_actual_twa.R new file mode 100644 index 0000000..b0a5537 --- /dev/null +++ b/tests/testthat/test_SFO_actual_twa.R @@ -0,0 +1,13 @@ +library(pfm) +context("Actual and time weighted average concentrations for SFO kinetics") + +test_that("SFO_actual_twa calculates correctly", { + test_times <- c(0, 1, 7, 21, 42) + # This was calculated with the CRD spreadsheet for multiple applications + reference <- data.frame( + actual = c(10, 9.330, 6.156, 2.333, 0.544), + twa = c(NaN, 9.661, 7.923, 5.267, 3.248), + row.names = test_times) + result <- round(10 * SFO_actual_twa(10, times = test_times), 3) + expect_equal(result, reference) +}) -- cgit v1.2.1