Assess whether a list of extents are all equal

equalExtent(extents)

# S4 method for list
equalExtent(extents)

Arguments

extents

list of extents objects

Author

Eliot McIntire

Examples

library(terra)

files <- system.file("maps", package = "quickPlot")
files <- dir(files, full.names = TRUE, pattern = "tif")
maps <- lapply(files, function(x) terra::rast(x))
names(maps) <- sapply(basename(files), function(x) {
  strsplit(x, split = "\\.")[[1]][1]
})
extnts <- lapply(maps, terra::ext)
equalExtent(extnts) ## TRUE
#> [1] TRUE