[R-sig-Geo] importing and exporting multiple rasters and keeping original filename

Martin martin_brandt at gmx.net
Wed Aug 24 11:07:47 CEST 2011


Hi,

I have a little problem. I want to import a bunch of rasters to R, do some
modifications, and export them again. 

I import them, create a stack or brick, and write everything to a multiband
file which can be opened by GRASS with writeRaster. However, doing this, all
original filenames are lost (I tried all possible formats).

Is there a way to save a stack to a multiband file and keep the original
names, or do I have to work with loops and seperate raster files?

like that:

for (f in list.files(pattern='1999_*')){ 
assign(f, raster(f)) 
} 

that works, but isn't very neat, and I struggle using loops with
writeRaster...





--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/importing-and-exporting-multiple-rasters-and-keeping-original-filename-tp6719381p6719381.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list