[R-sig-Geo] import ASCII file via RGDAL to SpatialPixelsDataFrame'

Edzer Pebesma edzer.pebesma at uni-muenster.de
Mon Mar 30 15:58:09 CEST 2009


Try:

Zone_2644149 = readGDAL("Zone_2644149.asc")


This returns a SpatialGridDataFrame.Then:

fullgrid(Zone_2644149) = FALSE

converts into a SpatialPixelsDataFrame, or, in a single command:

Zone_2644149 = as(readGDAL("Zone_2644149.asc"), "SpatialPixelsDataFrame")

--
Edzer


gianni lavaredo wrote:
> Dear R user,
>
> I have an ascii file (It's a raster in Arcmap) and I wish to import in R
> to do some analisys. I am using like help
>
> Zone_2644149 = readGDAL("Zone_2644149.asc")$band1
> Zone_2644149.asc has GDAL driver AAIGrid
> and has 246 rows and 381 columns
>
> str(Zone_2644149)
>  num [1:93726] 35.1 34.7 35.2 35.9 31.2 ...
>
> but I need to have a SpatialPixelsDataFrame but SORRY I haven't idea how to
> import as SpatialPixelsDataFrame
>
> thanks Gianni
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
http://www.springer.com/978-0-387-78170-9 e.pebesma at wwu.de



More information about the R-sig-Geo mailing list