Assess whether a list of extents are all equal

equalExtent(extents)

# S4 method for list
equalExtent(extents)

Arguments

extents

list of extents objects

Examples

# NOT RUN {
library(igraph)
library(raster)

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

# }