Skip to content

Commit

Permalink
update igraph use; interrupt depth-first search in n.comp.nb, add igr…
Browse files Browse the repository at this point in the history
…aph argument to n.comp.nb
  • Loading branch information
rsbivand committed Jun 13, 2024
1 parent 6509e17 commit fba58af
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion man/lm.RStests.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ lw <- nb2listw(COL.nb)
res <- lm.RStests(oldcrime.lm, listw=lw, test="all")
summary(res)
if (require("spatialreg", quietly=TRUE)) {
oldcrime.slx <- lm(CRIME ~ HOVAL + INC, data = COL.OLD, listw=lw)
oldcrime.slx <- lmSLX(CRIME ~ HOVAL + INC, data = COL.OLD, listw=lw)
summary(lm.RStests(oldcrime.slx, listw=lw, test=c("adjRSerr", "adjRSlag")))
}
}
Expand Down
1 change: 0 additions & 1 deletion man/localmoran.exact.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ When the alternative is being tested, a list of left and right M products in att
\examples{
eire <- st_read(system.file("shapes/eire.gpkg", package="spData")[1])
row.names(eire) <- as.character(eire$names)
st_crs(eire) <- "+proj=utm +zone=30 +ellps=airy +units=km"
eire.nb <- poly2nb(eire)
e.lm <- lm(OWNCONS ~ ROADACC, data=eire)
localmoran.sad(e.lm, nb=eire.nb)
Expand Down
1 change: 0 additions & 1 deletion man/localmoran.sad.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ Geographical Analysis, 34, pp. 187--206.}
\examples{
eire <- st_read(system.file("shapes/eire.gpkg", package="spData")[1])
row.names(eire) <- as.character(eire$names)
st_crs(eire) <- "+proj=utm +zone=30 +ellps=airy +units=km"
eire.nb <- poly2nb(eire)
lw <- nb2listw(eire.nb)
e.lm <- lm(OWNCONS ~ ROADACC, data=eire)
Expand Down
1 change: 0 additions & 1 deletion man/mstree.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ mstree(nbw, ini = NULL)
### loading data
bh <- st_read(system.file("etc/shapes/bhicv.gpkg",
package="spdep")[1], quiet=TRUE)
st_crs(bh) <- "OGC:CRS84"
### data padronized
dpad <- data.frame(scale(as.data.frame(bh)[,5:8]))

Expand Down
4 changes: 2 additions & 2 deletions man/nblag.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ run <- FALSE
if (require(igraph, quietly=TRUE) && require(spatialreg, quietly=TRUE)) run <- TRUE
if (run) {
W <- as(nb2listw(col.gal.nb), "CsparseMatrix")
G <- graph.adjacency(W, mode="directed", weight="W")
G <- graph_from_adjacency_matrix(W, mode="directed", weight="W")
D <- diameter(G)
nbs <- nblag(col.gal.nb, maxlag=D)
n <- length(col.gal.nb)
lmat <- lapply(nbs, nb2mat, style="B", zero.policy=TRUE)
mat <- matrix(0, n, n)
for (i in seq(along=lmat)) mat = mat + i*lmat[[i]]
G2 <- shortest.paths(G)
G2 <- distances(G)
print(all.equal(G2, mat, check.attributes=FALSE))
}
}
Expand Down
1 change: 0 additions & 1 deletion man/skater.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ skater(edges, data, ncuts, crit, vec.crit, method = c("euclidean",
### loading data
bh <- st_read(system.file("etc/shapes/bhicv.gpkg",
package="spdep")[1], quiet=TRUE)
st_crs(bh) <- "OGC:CRS84"
### data standardized
dpad <- data.frame(scale(as.data.frame(bh)[,5:8]))

Expand Down

0 comments on commit fba58af

Please sign in to comment.