tests/testthat/test-cortestR.R

# 
# out1 <- cortestR(mtcars[, c("wt", "mpg", "qsec")], split = FALSE, sign_symbol = TRUE)
# # separate coefficients and p-values
# out2 <- cortestR(mtcars[, c("wt", "mpg", "qsec")], split = TRUE, sign_symbol = FALSE)
# saveRDS(list(out1=out1, out2=out2),file = 'tests/testthat/cortestR_out.rda')
test_that("cortestR() with defaults and options set", {
  expected <- readRDS('cortestR_out.rda')
  expect_equal(cortestR(mtcars[, c("wt", "mpg", "qsec")], split = FALSE, sign_symbol = TRUE), expected[[1]])
  expect_equal(cortestR(mtcars[, c("wt", "mpg", "qsec")], split = TRUE, sign_symbol = FALSE), 
               expected[[2]])
})

Try the wrappedtools package in your browser

Any scripts or data that you put into this service are public.

wrappedtools documentation built on Sept. 24, 2023, 5:06 p.m.