Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Sep 23, 2023
2 parents d499b9a + e1ab31e commit 85f43d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* replace `rgrass7` with `rgrass` in vignette

* fix #133 (`edit.nb` affected by not attaching `sp`)

# Version 1.2-8 (2023-02-28)

* `mat2listw()` warning if no `style=` argument given, or if `M"` is given https://github.com/r-spatial/spatialreg/issues/24, https://github.com/r-spatial/spatialreg/issues/23.
Expand Down
4 changes: 2 additions & 2 deletions R/edit.nb.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ edit.nb <- function(name, coords, polys=NULL, ..., use_region.id=FALSE) {
plot.window(xlim = xlim, ylim = ylim, "", asp=1)
if (!is.null(polys))
if (inherits(polys, "SpatialPolygons"))
plot(polys, border="grey", add=TRUE)
sp::plot(polys, border="grey", add=TRUE)
else stop("polys of unknown class")
# bug report Conceicao Ribeiro 100731
for (i in 1:n) {
Expand Down Expand Up @@ -135,7 +135,7 @@ edit.nb <- function(name, coords, polys=NULL, ..., use_region.id=FALSE) {
plot.new()
plot.window(xlim = xlim, ylim = ylim, "", asp=1)
if (!is.null(polys))
plot(polys, border="grey", add=TRUE)
sp::plot(polys, border="grey", add=TRUE)
for (i in 1:n) {
if(nb[[i]][1]!=0 & length(nb[[i]])>0L)
segments(x[i],y[i],x[nb[[i]]],y[nb[[i]]])
Expand Down

0 comments on commit 85f43d7

Please sign in to comment.