tests/testthat/test-CCplot.R

set.seed(12)
a1 <- rnorm(20)
a2 <- rnorm(20) + 2
b1 <- rnorm(19)

test_that("Measurements must be same length", {
  expect_error(CCplot(a1, a2), NA)
  expect_error(CCplot(a1, b1))
})

test_that("Outputs scatterplot or MAplot", {
  expect_error(CCplot(a1, a2, Ptype = "scatter", subtitle = "ex1"), NA)
  expect_error(CCplot(a1, a2, Ptype = "MAplot", subtitle = "ex2"), NA)
})

test_that("Metrics have correct structure", {
  m <- CCplot(a1, a2, metrics = TRUE)
  expect_is(m, "numeric")
  expect_length(m, 3)
})

dev.off()
if (file.exists("Rplots.pdf")) file.remove("Rplots.pdf")

Try the nanostringr package in your browser

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

nanostringr documentation built on Aug. 15, 2023, 5:08 p.m.