[R-sig-Geo] ASCII grids as spatialgridframe

Els Ducheyne educheyne at avia-gis.be
Thu Jul 23 14:31:41 CEST 2009


Dear all
sorry to post this question, but I have been looking across multiple  
fora and haven't found the answer

I am trying to read ascii-grids in R using the shapefile -  
read.asciigrid
I have found that this is of class SpatialGridDataFrame
I would like to combine this with a set of grids that are already in  
the workspace but when i use the [[<-option I always get the following  
error
What am I doing wrong? I am not using rgdal, because of a linking  
error that I cannot seem to overcome - even though the installation of  
rgdal and all its dependencies didn't yield an erro

Thanks for any help!

  achandata<-read.asciigrid("achan.asc")
 > summary(achandata)
Object of class SpatialGridDataFrame
Coordinates:
            min    max
coords.x1 -2.5 1002.5
coords.x2 -2.5  502.5
Is projected: NA
proj4string : [NA]
Number of points: 2
Grid attributes:
   cellcentre.offset cellsize cells.dim
1                 0        5       201
2                 0        5       101
Data attributes:
    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  0.0000  0.0000  0.3000  0.7088  0.9000  6.2000
 > grids[["achan"]]<-achandata
Error: object is not subsettable
 > summary(grids)
Object of class SpatialGridDataFrame
Coordinates:
            min    max
coords.x1 -2.5 1002.5
coords.x2 -2.5  502.5
Is projected: NA
proj4string : [NA]
Number of points: 2
Grid attributes:
   cellcentre.offset cellsize cells.dim
1                 0        5       201
2                 0        5       101
Data attributes:
       elev            grad
  Min.   :119.8   Min.   :0.0008663
  1st Qu.:140.0   1st Qu.:0.0399718
  Median :144.0   Median :0.0620299
  Mean   :144.3   Mean   :0.0821328
  3rd Qu.:150.1   3rd Qu.:0.1129532
  Max.   :159.5   Max.   :0.3284767



More information about the R-sig-Geo mailing list