tests/testthat/test-ps_CV_corr.R

# test validity of ps_CV_corr

data(ObsidianSources)
analyticVars<-c("Rb","Sr","Y","Zr","Nb")
CV_corr<-ps_CV_corr(data = ObsidianSources, GroupVar="Code", Groups = "All",
        AnalyticVars=analyticVars, ByGroup=FALSE, plotCorrs = FALSE)

test_that("ps_CV_corr output is a list", {
  expect_type(CV_corr, "list")
})

#  use saved valid output from the function
data(testCV_corr)

test_that("ps_CV_corr correlations are correct", {
  expect_equal(CV_corr$corr, testCV_corr$corr)
})
benmarwick/karon documentation built on July 29, 2023, 10:11 a.m.