r <- rast(ncols=100, nrows=100)
values(r) <- 1:ncell(r)
x <- rast(ncols=2, nrows=2)
getTileExtents(r, x)
getTileExtents(r, x, buffer=3)
filename <- paste0(tempfile(), "_.tif")
ff <- makeTiles(r, x, filename)
ff
vrt(ff)
Run the code above in your browser using DataLab