[R-sig-Geo] distance matrix to listw

Michal Palenik michal.palenik at iz.sk
Mon May 19 10:17:47 CEST 2008


dear list,

I want to do analysis using lagsarlm function, however I am stuck on 
listw object. I have distances among spatial points in a mysql table in 
form:
point1_id | point2_id | distance (in km)

dataset in also in mysql table in form:
point_id | year | variable1 | variable2 | ....

so my questions:
1. how to I create a listw object from above mysql table ?

2. if i create data frame with command 
data<-dbGetQuery(con, "select * from data");
is it enough or some special actions need to be taken to connect data 
frame to listw object (eg so that lagsarlm knows which spatial point in 
data is which point in listw) ?


thanks in advance

michal palenik


-- 
michal palenik
institut zamestnanosti
michal.palenik at iz.sk




More information about the R-sig-Geo mailing list