tests/testthat/test-native.R

sstfile <- system.file("extdata/sst.tif", package = "vapour")
lr <- lazyraster(sstfile)
test_that("native works", {
  expect_equal(dim(as_raster(lr, native = TRUE)), c(286L, 143L, 1L))
  expect_equal(dim(as_raster(lr, dim = c(10, 10))), c(10L, 10L, 1L))
  expect_equal(dim(as_raster(crop(lr, raster::extent(145, 149, -58, -55)), dim = c(10, 10))), c(10L, 10L, 1L))
})

Try the lazyraster package in your browser

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

lazyraster documentation built on Oct. 7, 2021, 5:08 p.m.