[R-sig-Geo] error in SpatialGridDataFrame

Edzer J. Pebesma e.pebesma at geo.uu.nl
Thu Apr 5 11:10:19 CEST 2007


temiz wrote:
> hello
>
> when I followed the steps of  ORDINARY KRIGING IN R WITH GRASS6 DATA in 
> GRASS 6 Tutorial.
>
> I encountered this error:
>
>  > mask_SG <- 
> SpatialGridDataFrame(grd,data=list(k=rep(1,G$cols3*G$rows3)),proj4string=CRS(G$proj4))
> Error in validObject(.Object) : invalid class "SpatialGridDataFrame" 
> object: invalid object for slot "data" in class "SpatialGridDataFrame": 
> got class "list", should be or extend class "data.frame"
>
>
> can you tell me why ?
>   
Yes. The data slot changed from list to data.frame, at some stage, for 
good reasons.

Replace list(... with data.frame(... and you're fine.
--
Edzer




More information about the R-sig-Geo mailing list