From f4fcef8228ebd5a1a73bc6edc47b5efa259c2e20 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 23 Mar 2022 10:32:36 +0100 Subject: Use 'investr' conditionally in tests, updates Most prominently, a README was added, giving a nice overview for the people visiting the github page, the package page on CRAN, or the online docs at pkgdown.jrwb.de. The maintainer e-mail address was also updated. --- tests/testthat/test_compare_investr.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/testthat/test_compare_investr.R b/tests/testthat/test_compare_investr.R index 6191c89..2830679 100644 --- a/tests/testthat/test_compare_investr.R +++ b/tests/testthat/test_compare_investr.R @@ -1,12 +1,12 @@ -context("Compare with investr::calibrate") +if (requireNamespace("investr")) { -library(chemCal) -library(investr) +context("Compare with investr::calibrate") test_that("Unweighted regressions give same results as investr::calibrate using the Wald method", { + compare_investr <- function(object, y_sample) { pred_chemCal <- inverse.predict(object, y_sample) - pred_investr <- calibrate(object, y_sample, interval = "Wald") + pred_investr <- investr::calibrate(object, y_sample, interval = "Wald") expect_equivalent(pred_chemCal[["Prediction"]], pred_investr$estimate) expect_equivalent(pred_chemCal[["Standard Error"]], @@ -28,3 +28,5 @@ test_that("Unweighted regressions give same results as investr::calibrate using m_m3 <- lm(y ~ x, massart97ex3) compare_investr(m_m3, 15) }) + +} -- cgit v1.2.1