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@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.pebe...@wwu.de _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo