-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d8fbdc
commit e6cddf3
Showing
2 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
data("sample_explan_data") | ||
random_cat_layer <- terra::rast(sample_extent_data) | ||
random_cat_layer <- terra::setValues(random_cat_layer, | ||
sample(0:10, terra::ncell(random_cat_layer), | ||
replace = TRUE)) | ||
|
||
test_that("Works if static rasters and buffering", { | ||
results<-extract_static_coords(occ.data = sample_explan_data, | ||
varnames = "random_cat_layer", | ||
static.rasters = random_cat_layer) | ||
expect_equal(ncol(results), ncol(sample_explan_data)+1) | ||
}) | ||
|
||
|
||
test_that("Works if static rastersx2 and buffering", { | ||
results<-extract_static_coords(occ.data = sample_explan_data, | ||
varnames = c("random_cat_layer","random_cat_layer2"), | ||
static.rasters = c(random_cat_layer,random_cat_layer)) | ||
expect_equal(ncol(results), ncol(sample_explan_data)+2) | ||
}) | ||
|
||
|
||
|
||
test_that("Works if static rastersx2 and buffering", { | ||
results<-extract_static_coords(occ.data = sample_explan_data, | ||
varnames = c("random_cat_layer","random_cat_layer2"), | ||
static.rasters = c(random_cat_layer,random_cat_layer), | ||
moving.window.matrix = matrix(1,3,3), | ||
GEE.math.fun = "sum") | ||
expect_equal(ncol(results), ncol(sample_explan_data)+2) | ||
}) | ||
|