Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

i want to export a grid from R into format readable by ArcGIS. how can i do so?


share|improve this question

migrated from stackoverflow.com Dec 5 '12 at 13:43

This question came from our site for professional and enthusiast programmers.

You need to specify what the target software can read, or at least what version of it you are using so someone can find out. Recent versions of ArcGIS use GDAL so rgdal is the best place to start. GeoTIFF is generally the best choice unless you have special needs –  mdsumner Dec 5 '12 at 12:46
The target software is ArcGIS 10. I just wanted an output of the formart a ascii with some header information on x and y coordinates, NA, ncol and nrow. –  jonestats Dec 5 '12 at 13:31
In the future, when posting, please consider providing more specifics so the community can provide relevant answers without the need for you to clarify you question. Your reference to "grid" in R is vague at best and could be interpreted as a matrix class, raster class or sp class object. Since some spatial packages in R return a matrix you may need to coerce to a raster object before export to an ASCIIGrid is feasible. For all we know you wanted to end up with an X,Y,Z triplicate. –  Jeffrey Evans Dec 5 '12 at 17:41
FWIW raster, sp, and rgdal all provide independent support to create ESRI Ascii files, but it's a very poor choice given the lack of projection metadata, tiling, or compression and inconsistent support for non-square cells –  mdsumner Dec 5 '12 at 19:28
add comment

1 Answer

The raster package has functions to read and write GRID files.

Other packages for working with spatial data and interacting with GIS software can be found in the spatial task view on CRAN: http://cran.r-project.org/web/views/Spatial.html

share|improve this answer
Thanks, i found the package RSAGA useful and i have solved the issue. –  jonestats Dec 5 '12 at 13:05
+1 raster package –  Aaron Dec 5 '12 at 14:22
There is also the rgdal package. I am not sure how RSAGA would solve your export problem. The data engine behind SAGA is GDAL so using the rgdal package would allow you to export a raster info any number of formats readable by ArcGIS, including ascii grid. I would however, recommend img. –  Jeffrey Evans Dec 5 '12 at 17:33
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.