[R-sig-Geo] export to .asc or .grd files
Carsten Neumann
carstennh at aol.com
Tue Dec 21 12:21:49 CET 2010
Am 20.12.2010 18:02, schrieb Maxime Pauwels:
> Hi list,
>
> I'm using the sp package to grid data. I'd now like to export the grid
> in either .asc or .grd files. Does anyone can give me the package and
> function that does it easily?
>
> Thanks,
>
> max
>
Hi Max,
library(raster); use with function: writeRaster("raster object", "name",
format="ascii"); format="raster" for *.grd files
library(rgdal); use with function: writeGDAL("rgdal object",
fname="name", drivername="AAIGrid"); use gdalDrivers() to identify your
preferred drivername for *.grd
you certainly have to change your grid object to a raster object when
using raster package.
All the best!
Carsten
More information about the R-sig-Geo
mailing list