Skip to content

Commit

Permalink
addresses #144
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Mar 20, 2024
1 parent 208f1b3 commit 97ca382
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: spdep
Version: 1.3-4
Date: 2024-02-07
Date: 2024-03-27
Title: Spatial Dependence: Weighting Schemes, Statistics
Encoding: UTF-8
Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"),
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* fix https://github.com/edzer/sdsr/issues/121, wrong assignment of old test names in `lmRStests`

* fix #144 in `plot.nb` and `nb2lines`

# Version 1.3-3 (2024-02-07)

* change `lm.LMtests` to `lm.RStests` and re-name Lagrange multiplier to Rao's score; add `GNM_` prefix to test names if the input object inherits from `SlX` created by `spatialreg::lmSLX` (Koley, forthcoming)
Expand Down
5 changes: 3 additions & 2 deletions R/nb2lines.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ nb2lines <- function(nb, wts, coords, proj4string=NULL, as_sf=FALSE) {

if (inherits(coords, "sfc")) {
if (!inherits(coords, "sfc_POINT")) {
if (inherits(coords, "sfc_POLYGON") ||
inherits(coords, "sfc_MULTIPOLYGON"))
# if (inherits(coords, "sfc_POLYGON") || #144
# inherits(coords, "sfc_MULTIPOLYGON"))
if (all(st_dimension(coords) == 2))
coords <- sf::st_point_on_surface(coords)
else stop("Point-conforming geometries required")
}
Expand Down
6 changes: 4 additions & 2 deletions R/plot.nb.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ plot.nb <- function(x, coords, col="black", points=TRUE, add=FALSE,

if (inherits(coords, "sfc")) {
if (!inherits(coords, "sfc_POINT")) {
if (inherits(coords, "sfc_POLYGON") ||
inherits(coords, "sfc_MULTIPOLYGON"))
# if (inherits(coords, "sfc_POLYGON") || #144
# inherits(coords, "sfc_MULTIPOLYGON"))
#
if (all(st_dimension(coords) == 2))
coords <- st_point_on_surface(coords)
else stop("Point-conforming geometries required")
}
Expand Down

0 comments on commit 97ca382

Please sign in to comment.