[R-sig-Geo] edit.nb problem with an island
Roger Bivand
Roger.Bivand at nhh.no
Mon Oct 2 22:02:16 CEST 2017
How many observations in total? If not to many, edit.nb() should still work, but I doubt that it will work in an IDE like Rstudio.
Roger Bivand
Norwegian School of Economics
Bergen, Norway
Fra: Wheeler-Martin, Katherine
Sendt: mandag 2. oktober, 21.49
Emne: Re: [R-sig-Geo] edit.nb problem with an island
Til: r-sig-geo at r-project.org
Dear all, I am encountering an issue related to an old thread from 2011 (pasted below), and would like to know if someone could provide sample code for when one wishes to manually delete contiguity between two points, while retaining all other contiguities for those points. I am relatively new with R, so I apologize if this is obvious! Thank you, Katie Dear Alexander, Following your suggestion I have used this syntax and works perfectly: x.nb[[67]] = as.integer(sort(c(43,53))) x.nb[[43]] = as.integer(sort(c(x.nb[[43]],67))) x.nb[[53]] = as.integer(sort(c(x.nb[[53]],67))) Thank you very much for your help! Marc 2011/5/17 Alexander Werner >: > Dear Marc, > > facing a similar problem I choose to correct the NB object manually: > > NBDKR439[[350]]= as.integer(sort(c(NBDKR439[[350]],362))) > NBDKR439[[362]]= as.integer(350) > > Hope this helps, > Alexander > > > > Am 16.05.2011 19:01, schrieb Marc Mar� Dell'Olmo: >> >> Dear all, >> >> I have a cartography with an island, i.e. a polygon that doesn't share >> border with other polygons (CODIGO=3120104012). I would like to >> manually assign two areas (CODIGO=3120103024 and CODIGO=3120103014) as >> a neighborhood areas of this island with the edit.nb function, and >> after that to obtain the neighborhood matrix. I have followed this >> syntax and I don't understand why the summary(x.nb2) still shows one >> region with no link... >> >> If it helps, you can download the map at: >> http://dl.dropbox.com/u/14934021/map.zip >> >> >> Thank you very much, >> >> Marc >> >> map> map> >> >> x.nb> summary(x.nb) >> >> #Neighbour list object: >> #Number of regions: 122 >> #Number of nonzero links: 724 >> #Percentage nonzero weights: 4.864284 >> #Average number of links: 5.934426 >> #1 region with no links: >> #66 >> #Link number distribution: >> >> #0 2 3 4 5 6 7 8 9 10 11 12 14 >> #1 1 7 19 22 31 21 12 2 2 2 1 1 >> #1 least connected region: >> #101 with 2 links >> #1 most connected region: >> #29 with 14 links >> >> nb> which(card(nb) == 0) >> attr(nb, "region.id")[which(card(nb) == 0)] >> >> >> x.nb2> >> #> x.nb2> #Identifying contiguity for deletion ... >> #No contiguity between chosen points >> #Add contiguity? (y/n) y >> #added contiguity between point 53 and 67 >> #Options: quit[q] refresh[r] continue[c] c >> #Identifying contiguity for deletion ... >> #No contiguity between chosen points >> #Add contiguity? (y/n) y >> #added contiguity between point 43 and 67 >> #Options: quit[q] refresh[r] continue[c] q >> >> >> summary(x.nb2) >> >> #Neighbour list object: >> #Number of regions: 122 >> #Number of nonzero links: 726 >> #Percentage nonzero weights: 4.877721 >> #Average number of links: 5.95082 >> #1 region with no links: >> #66 >> #Non-symmetric neighbours list >> #Link number distribution: >> >> #0 2 3 4 5 6 7 8 9 10 11 12 14 >> #1 1 7 18 22 32 21 12 2 2 2 1 1 >> #1 least connected region: >> #101 with 2 links >> #1 most connected region: >> #29 with 14 links >> >> _______________________________________________ >> R-sig-Geo mailing list >> R-sig-Geo at r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo >> > > -- > Dipl.-�k. Alexander Werner > _______________________________________________ > Universit�t Kassel > Fachbereich Wirtschaftswissenschaften > Fachgebiet Empirische Wirtschaftsforschung > Nora-Platiel-Str. 4 > 34109 Kassel > > Tel.: 0561 / 804 - 3044 > werner at wirtschaft.uni-kassel.de > http://cms.uni-kassel.de/unicms/index.php?id=31247 > _______________________________________________ > > Katie Wheeler-Martin, MPH Senior Data Analyst Department of Surgery New York University School of Medicine 550 First Avenue New York, NY 10016 Office: 1.212.263.6308 katherine.wheeler-martin at nyumc.org ------------------------------------------------------------ This email message, including any attachments, is for th...{{dropped:14}}
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list