[R-sig-Geo] spdep and server

Matilde Karakachoff karaka at ifc.cnr.it
Thu Dec 1 21:36:10 CET 2011


Ok ok, thanks to all!

The "lazy" was me! The server admin updated R and packages two days 
ago, but not me!

R version on my Windows C is

R version 2.13.1 (2011-07-08)

and sp version

Package: sp
Version: 0.9-88
Date: 2011-09-14

I haven't access to server now, but I took note and I will run it next
monday.

Thankyou very much,
Matilde




On Thu, 01 Dec 2011 18:41:17 +0100 (CET), Roger Bivand wrote:

> On Thu, 1 Dec 2011, jon.skoien at jrc.ec.europa.eu [1]wrote:
>
>> On 01-Dec-11 17:28, Barry Rowlingson wrote:
>>
>>> Its nothing to do with spdep because this is only using the sp
>>> package and not spdep. This is what we call a reproducible example:
>>> library(sp)
>>> d=data.frame(x=rep(1:4,4),y=rep(1:4,rep(4,4)),z=runif(16))
>>> coordinates(d)=~x+y d.sp=as(d,"SpatialPixels")
>>> d.gr=as(d.sp,"SpatialGridDataFrame") and that works for me. Cut n
>>> paste it and see if it works for you. Then tell us this:
>>>
>>>> packageDescription("sp")
>>> Package: sp Version: 0.9-88 Date: 2011-09-14 [etc]
>> Then it actually seems to be an sp and/or R version problem. Your
>> example works for an old version on my Windows computer (R 2.12.1,
>> sp_0.9-76), but not for the newest version (R 2.14.0, sp_0.9-91). It
>> seems the old version didnt remove the data after the fourth line
>> whereas the new version does.
>
> Yes, current 0.9-91 shows the reported behaviour, so the server is
> running
> the updated version, the local Windows machine is out of date. We 
> have
> been trying to get the classes to inherit properly - earlier code
> stepped
> around things that either didn't work then, or we didn't grasp, in S4
> classes. In fact, doing:
>
> d.sp=as(d,"SpatialPixels")
> d.gr=as(d.sp,"SpatialGridDataFrame")
>
> should fail, because d.sp has no attribute data, so cannot be coerced 
> to
>
> SpatialGridDataFrame. This does work:
>
> summary(d)
> d.sp=as(d,"SpatialPixelsDataFrame")
> d.gr=as(d.sp,"SpatialGridDataFrame")
> summary(d.gr)
>
> but Jon's suggestion is equally adeqate.
>
> Roger
>
>> Cheers, Jon

-- 
Matilde Karakachoff
Istituto di Fisiologia Clinica
Pisa Italia


Links:
------
[1] mailto:jon.skoien at jrc.ec.europa.eu



More information about the R-sig-Geo mailing list