tests/testthat/test-save_correlation_matrix.R

test_that("a file is created", {

  file <- tempfile()
  on.exit(unlink(file))

  df = data.frame(
    mtcars$mpg, mtcars$cyl)

  expect_false(file.exists(file))

  save_correlation_matrix(df, filename = file)

  expect_true(file.exists(file))

})

Try the corrtable package in your browser

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

corrtable documentation built on Nov. 3, 2023, 1:11 a.m.