From 6468bc31254baeac7dad90a38715714291be30ae Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 2 Mar 2022 08:30:46 +0100 Subject: Add a test for tffm0() --- tests/testthat/test_tffm0.R | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/testthat/test_tffm0.R (limited to 'tests') diff --git a/tests/testthat/test_tffm0.R b/tests/testthat/test_tffm0.R new file mode 100644 index 00000000..82e1ee94 --- /dev/null +++ b/tests/testthat/test_tffm0.R @@ -0,0 +1,10 @@ +test_that("The formation fraction transformation tffm0 is reversible", { + ff_example <- c( + 0.10983681, 0.09035905, 0.08399383 + ) + ff_example_trans <- tffm0(ff_example) + expect_equal(invtffm0(ff_example_trans), ff_example) + + ff_ex_2_trans <- c(0.5, 0.9, 0.99) + expect_true(sum(invtffm0(ff_ex_2_trans)) < 1) +}) -- cgit v1.2.1