Skip to content
Prev 10539 / 29559 Next

RASTER library: one idea to merge several file in a loop

Gianni,

# make a list of file names, perhaps like this:
f <-list.files(pattern = ".asc")

# turn these into a list of RasterLayer objects
r <- lapply(f, raster)

# as you have the arguments as a list call 'merge' with 'do.call'
x <- do.call(merge, r)

Best, Robert

On Fri, Dec 24, 2010 at 7:23 AM, gianni lavaredo
<gianni.lavaredo at gmail.com> wrote: