Skip to content

Commit

Permalink
Make Visium HD graph
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdamoses committed Nov 16, 2024
1 parent ecbe7b9 commit fece636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/graph_wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ findVisiumHDGraph <- function(x, style = "W", queen = FALSE,
}
cols <- paste0("index_", sides)
gm <- as.matrix(df[,..cols])
gm <- gm + 1L # Convert to 1 based indexing for spdep
gm <- apply(gm, 1, sort) # This is the slowest part
colnames(gm) <- NULL
g <- apply(gm, 1, function(x) x[!is.na(x)])
class(g) <- "nb"
Expand Down

0 comments on commit fece636

Please sign in to comment.