I have a list of rasters with the same projection and resolution but different origins and I need to merge them in a single raster file.
Here's my code
l <- list.files('path', full.names=TRUE) lst <- lapply(l, raster) r_merged <- do.call(raster::merge, lst) Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE, : different origin
Here's what I'd like to get. Blue squares are original rasters, I want to get a single raster as the red square.