Skip to content

Commit

Permalink
fixes #143
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Jan 18, 2024
1 parent b815397 commit 5ed17a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Version 1.3-2 (development)

* #143 `row.names` pass-through in `poly2nb` corrected, harmonised `row.names` pass-through also in `nbdists` and `dnearneigh`

* #139 add `na.action` argument to `geary.test`, `geary.mc` and `globalG.test`

* add `style` to `sn2listw` use in `tri2nb`
Expand Down
1 change: 1 addition & 0 deletions R/dnearneigh.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dnearneigh <- function(x, d1, d2, row.names=NULL, longlat=NULL, bounds=c("GE", "
&& !is.na(is.projected(x)) && !is.projected(x)) {
longlat <- TRUE
} else longlat <- FALSE
if (is.null(row.names)) row.names <- row.names(x)
x <- coordinates(x)
} else if (inherits(x, "sf") || inherits(x, "sfc")) {
if (inherits(x, "sf")) {
Expand Down
1 change: 1 addition & 0 deletions R/nbdists.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ nbdists <- function(nb, coords, longlat=NULL) {
&& !is.na(is.projected(coords)) && !is.projected(coords)) {
longlat <- TRUE
} else longlat <- FALSE
if (is.null(row.names)) row.names <- row.names(coords)
coords <- coordinates(coords)[, 1:2]
} else if (inherits(coords, "sf") || inherits(coords, "sfc")) {
if (inherits(coords, "sf")) {
Expand Down
2 changes: 1 addition & 1 deletion R/poly2nb.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ poly2nb <- function(pl, row.names=NULL, snap=sqrt(.Machine$double.eps),
sf <- FALSE
} else {
if (inherits(pl, "sf")) {
row.names <- row.names(pl)
if (is.null(row.names)) row.names <- row.names(pl)
regid <- NULL
pl <- sf::st_geometry(pl)
}
Expand Down

0 comments on commit 5ed17a7

Please sign in to comment.