[R-sig-Geo] spdep and server

Matilde Karakachoff karaka at ifc.cnr.it
Thu Dec 1 15:45:43 CET 2011


Ok, I’m sorry. I think that there was a little problem with my previous 
message.

I’m trying to execute some R commands on a linux server (where I 
installed R and packages previously) to create a SpatialGridDataFrame. 
It has to be a grid 10*10 to which I will associate data resulting from 
simulations of the spatial distribution of genotypic data (Fregene).


Some lines and columns of my data frame:
coord	x	y	f.all1s1	f.all2s1
4040	40	40	0,665	0,335	0,05346675
4041	40	41	0,72	0,28	0,049152
4042	40	42	0,825	0,175	0,04141875
4043	40	43	0,81	0,19	0,042483
4044	40	44	0,82	0,18	0,041772
4045	40	45	0,59	0,41	0,059643
4046	40	46	0,585	0,415	0,06006675
4047	40	47	0,405	0,595	0,07632075

My script:
>library(spdep)
>Locus1 <- read.csv2(file='data.csv', head=T)
>coordinates(Locus1) <- c('x', 'y')
>Locus1.sp <- as(Locus1, 'SpatialPixels')
>Locus1.gr <- as(Locus1.sp, 'SpatialGridDataFrame')

The first four lines are ok, but the last one gives the following 
error:

Error in asMethod(object, Class, value) : replace-coercion not allowed

But if I run it on my computer it works. So, why it doesn’t work on a 
server? May be the ‘spdep’ package doesn't work in the same way on 
linux?
Thanks a lot,

Matilde




-- 
Matilde Karakachoff
Istituto di Fisiologia Clinica
Pisa Italia



More information about the R-sig-Geo mailing list