From e1ab31e44c319044cd43f8c5b81580f7d0bf8fc5 Mon Sep 17 00:00:00 2001 From: Roger Date: Wed, 30 Aug 2023 17:45:17 +0200 Subject: [PATCH] fix #133 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/edit.nb.R | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 74892048..8000f788 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: spdep Version: 1.2-9 -Date: 2023-08-17 +Date: 2023-08-30 Title: Spatial Dependence: Weighting Schemes, Statistics Encoding: UTF-8 Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), diff --git a/NEWS.md b/NEWS.md index 4126fcb3..d470bca6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,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. diff --git a/R/edit.nb.R b/R/edit.nb.R index 0be7df05..5a4def48 100644 --- a/R/edit.nb.R +++ b/R/edit.nb.R @@ -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) { @@ -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]]])