Skip to content
Prev 6160 / 29559 Next

ASCII grids as spatialgridframe

On Thu, 23 Jul 2009, Els Ducheyne wrote:

            
This is not a shapefile at all.
Preferably use readGDAL() in rgdal, and note that the equivalent 
readAsciiGrid() in maptools allows for ESRI's locale oddities while the 
version in sp does not. But in general just use readGDAL().
You are trying to assign a SpatialGridDataFrame object to a column in 
grids, another SpatialGridDataFrame. Why not use the cbind() method for 
these objects, for example:

grids1 <- cbind(grids, achandata)
names(grids) <- c("elev", "grad", "achan")

Alternatively, but more error-prone is:

an <- names(achandata)
grids$achan <- achandata[[an[1]]]

- the name is most likely "band1", but we don't know.

Hope this helps,

Roger