tests/testthat/testInteractionABCplot.r

#devtools::test("dae")
context("interactionPlot")

cat("#### Test interaction.ABC.plot\n")
test_that("interaction.ABC.plot", {
  skip_on_cran()
  library(dae)
  #'# PBIBD(2) from p. 379 of Cochran and Cox (1957) Experimental Designs. 2nd edn Wiley, New York"
 
  data(ABC.Interact.dat)
  testthat::expect_silent(plt <- interaction.ABC.plot(MOE, A, B, C, data=ABC.Interact.dat))
  vdiffr::expect_doppelganger("ABCInteract-Plain", plt)
  
  testthat::expect_silent(plt <- interaction.ABC.plot(MOE, A, B, C, 
                                               xlab = "Factor A", 
                                               ylab = "M.O.E.", data=ABC.Interact.dat))
  vdiffr::expect_doppelganger("ABCInteract-Labs", plt)
  
  
  ABC.Interact.dat$se <- rep(c(0.5,1), each=4)
  testthat::expect_silent(
    plt <- interaction.ABC.plot(MOE, A, B, C, data=ABC.Interact.dat,
                                ggplotFunc=list(geom_errorbar(data=ABC.Interact.dat, 
                                                              aes(ymax=MOE+se, ymin=MOE-se), 
                                                              width=0.2))))
  vdiffr::expect_doppelganger("ABCInteract-Error", plt)

})

Try the dae package in your browser

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

dae documentation built on Aug. 7, 2023, 5:08 p.m.