library(testthat)
test_that("Plot ROCs", {
set.seed(123)
data <- EmpiricalCalibration::simulateControls(n = 50 * 3, trueLogRr = log(c(1, 2, 4)))
fileName <- tempfile(fileext = ".png")
plot <- plotRocsInjectedSignals(
logRr = data$logRr, trueLogRr = data$trueLogRr, showAucs = TRUE,
fileName = fileName
)
expect_false(is.null(plot))
expect_true(file.exists(fileName))
unlink(fileName)
})
test_that("Plot coverage", {
set.seed(123)
data <- EmpiricalCalibration::simulateControls(n = 50 * 3, trueLogRr = log(c(1, 2, 4)))
fileName <- tempfile(fileext = ".png")
plot <- plotCoverageInjectedSignals(
logRr = data$logRr, seLogRr = data$seLogRr, trueLogRr = data$trueLogRr,
fileName = fileName
)
expect_false(is.null(plot))
expect_true(file.exists(fileName))
unlink(fileName)
})
test_that("Plot controls", {
set.seed(123)
data <- EmpiricalCalibration::simulateControls(n = 50 * 3, trueLogRr = log(c(1, 2, 4)))
fileName <- tempfile(fileext = ".png")
plot <- plotControls(
logRr = data$logRr, seLogRr = data$seLogRr, trueLogRr = data$trueLogRr,
fileName = fileName
)
expect_false(is.null(plot))
expect_true(file.exists(fileName))
unlink(fileName)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.