View source: R/testthat-helper-plots.R
expect_equal_plots | R Documentation |
This function compares a stored .svg of a plot, to the plot that is created when the tests are run.
If no .svg exists yet then you must first run manageTestPlots
.
expect_equal_plots(test, name, dir = lifecycle::deprecated())
test |
The plot object you wish to test (does not work well for non-ggplot2 objects). |
name |
The name of the reference plot (a .svg stored in /tests/testthat/_snaps). |
dir |
options <- analysisOptions("BinomialTest")
options$variables <- "contBinom"
options$descriptivesPlots <- TRUE
results <- runAnalysis("BinomialTest", "test.csv", options)
testPlot <- results[["state"]][["figures"]][[1]][["obj"]]
expect_equal_plots(testPlot, "descriptives-1", dir = "BinomialTest")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.