tests/testthat/test-is-type-grDevices.R

test_that("test.is_raster.a_matrix.returns_false", {
  m <- matrix(hcl(0, 80, seq(50, 80, 10)), nrow = 4, ncol = 5)
  expect_false(is_raster(m))
})

test_that("test.is_raster.a_raster.returns_true", {
  m <- matrix(hcl(0, 80, seq(50, 80, 10)), nrow = 4, ncol = 5)
  expect_true(is_raster(as.raster(m)))
})

Try the assertive.types package in your browser

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

assertive.types documentation built on May 1, 2019, 10:31 p.m.