Closed agila5 closed 3 months ago
Or alternatively, all(st_dimension(coords) == 2)
https://github.com/r-spatial/spdep/commit/97ca382a40d6fb22186cb9fdfd14f26cbc1bf6ad seems to deal with this, using @edzer 's helpful suggestion. Also corrected in nb2lines
. Please let me know if this resolves the problem for you, @agila5
Works perfectly, thank you both!
Dear @rsbivand, I just started reading Chapters 14 and 15 of https://r-spatial.org/book/, and I found the following (IMO slightly annoying) behaviour which is detailed in the next reprex.
Then, I checked
?plot.nb
and I noticed that the function requires acoords
argument that can be specified as asfc
object (with point or polygons). However:whereas
After some simple debugging, I noticed that the problem occurs here https://github.com/r-spatial/spdep/blob/208f1b3bb27f52865afd0d11497dd179509b728f/R/plot.nb.R#L11-L14 since
which implies that
Created on 2024-03-20 with reprex v2.0.2
Do you think it might be reasonable to replace the previous test with something like?