I have two dem files downloaded via the getData
function in the raster package.
Here you can see the code:
I tried to make the example reproducible so there you have it.
library(raster)
dem_n1<-getData("SRTM",lon=26,lat=43)
dem_n2<-getData("SRTM",lon=31,lat=43)
demALL<-merge(dem_n1,dem_n2)
While attempting to perform the merge, the following error appears:
Error in compareRaster(x, extent = FALSE, rowcol = FALSE, orig = TRUE, :
different origin