[R-sig-Geo] problem with edit.nb

Michał Kwieciński jamesbond6 at gmail.com
Thu Aug 26 15:38:26 CEST 2010


Hi all,

I am just about to finish my thesis. The spatial model I want to use
there is an extension of some work I did back in April. I used R 2.9.2
then and in order to include 3 additional administrative areas for
Poland, I edited the shp files (the borders aren't perfectly aligned).
Then in R I created the nb class object and edited it with edit.nb
adding three new connections. Everything worked perfect, I had no
regions with no links and I generated weight matrices with no
problems.

However, I'd been doing exactly the same thing entire night in R 2.11
and it did not work (I use the same code I did 4 months ago) and I
have no idea what is the reason for it. I've been looking for some
other way to do it, I tried nb2mat and editing the matrix, but I
surrendered having no idea where and what values I should use.

Before editing nb object R claims that regions 377 and 378 have no
links. However in edit.nb the 378 and 379 are visible as having no
links (378 and 379 are cities added on top of bigger shapes, whereas
377 was just split from a bigger shape into two smaller ones and only
the link between these two parts is missing). I connect the circles,
quit and in the new object there are some new links - the overall
number has increased - but 377 and 378 are still listed as having no
links. Editing nb again shows the links, so they have been saved for
sure.

I am not an advanced R user and most of my code was based on my
professor's book. However, I think I have spent enough time with
spatial models and those matrices in order to call this problem really
weird. Especially since it worked perfectly last time...

I can attach shp files and my code if it will be of any help in order
to properly investigate this problem. I would really appreciate some
help, I need to finish the project over the weekend.

Thanks in advance, best regards,
Michal Kwiecinski
University of Warsaw student



More information about the R-sig-Geo mailing list