[R] importing ascii grids (for gstat)

Roger Bivand Roger.Bivand at nhh.no
Tue Feb 17 16:33:37 CET 2004


On Tue, 17 Feb 2004, femke wrote:

> Hello,
> 
> Is there anyone who could give me an example of how to import an ascii
> grid (i.e. ArcGIS exported raster) into R.  I want to use it with gstat
> but don't know the appropriate import routine.

On a Unix/Linux platform, you can use the rgdal library (after having 
compiled and installed the external GDAL libraries). But if you look at 
the grid file in a text viewer/editor, you'll see that its format is very 
simple, so reading using connections is quite possible. See

> ?connections

and

> ?readLines

should do it in a platform-neutral way.

> 
> Thanks very much for your help.
> 
> Regards,
> 
> femke
> 
> 
> Femke Reitsma
> Graduate Student (ABD)
> Geography Department
> 2181 LeFrak Hall
> University of Maryland
> College Park, MD 20742
> Phone: 301-405-4121
> E-mail: femke at geog.umd.edu
> http://www.glue.umd.edu/~femke/
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger Bivand
Econonic Geography Section, Department of Economics, Norwegian School of 
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, 
Norway, voice: +47-55959355, fax: +47-55959393; Roger.Bivand at nhh.no




More information about the R-help mailing list