tests/testthat/test_pvts_resample.R

library(testthat)
library(stars)
library(raster)
library(PVts)

context("pvts_resample")

test_that("pvts_resample works - stars", {
  data("pvts_datasets")
  x <- pvts_datasets$mosaic[1]
  new_x1 <- st_warp(x,cellsize = 15,crs = st_crs(x)) %>% as('Raster')
  names(new_x1) <- 'st_warp'
  new_x2 <- pvts_resample(x,new_x1)
  names(new_x2) <- 'pvts_resample'
  expect_equal(maxValue(new_x2), maxValue(new_x1))
})
pvts-approach/PVts documentation built on July 1, 2019, 4:59 p.m.