tests/testthat/test_04_plot_all.R

context("Verify graphics: Plot all")

test_that("Graphics parameters are not changed by plotting", {

  par_0 <- par(no.readonly = TRUE)

  # Create FFTrees object:
  heart_fft <- FFTrees(
    formula = diagnosis ~ .,
    data = utils::head(heartdisease, 25),  # reduced set
    quiet = TRUE
  )

  # Main:
  plot(heart_fft,
       what = "all",
       main = "Heart disease diagnosis",
       decision.labels = c("absent", "present")
  )

  testthat::expect_equal(par_0, par(no.readonly = TRUE))

  par(par_0)

})

# eof.

Try the FFTrees package in your browser

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

FFTrees documentation built on June 7, 2023, 5:56 p.m.