From cc3795c991cf05e6689cb1735b8effe507cda18f Mon Sep 17 00:00:00 2001 From: Roger Bivand Date: Sun, 24 Nov 2024 16:09:00 +0100 Subject: [PATCH] Update read.gwt2nb.R --- R/read.gwt2nb.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/read.gwt2nb.R b/R/read.gwt2nb.R index 357564f..742a1b2 100644 --- a/R/read.gwt2nb.R +++ b/R/read.gwt2nb.R @@ -304,7 +304,7 @@ write.swmdbf <- function(listw, file, ind, region.id = attr(listw, "region.id")) to <- as.integer(to) if (anyNA(to)) stop("to character indices could not be coerced to integer") } else if (smt == "double") { - oto <- as.integer(round(to) + oto <- as.integer(round(to)) to <- as.integer(to) if (any(to != oto)) stop("to double indices could not be coerced to integer") } else stop("to indices invalid: ", smt)