Skip to content

Commit

Permalink
update deprecated igraph function names
Browse files Browse the repository at this point in the history
  • Loading branch information
see24 committed Mar 13, 2024
1 parent 38277cb commit f1f845e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Encoding: UTF-8
LazyData: true
Imports:
dplyr,
igraph,
igraph (>= 2.0.3),
data.table,
sf,
units,
Expand Down
2 changes: 1 addition & 1 deletion R/mstList.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mstList<- function(sim){
mst.paths <- igraph::mst(mst.g, weighted=TRUE)

# get raster indexs for mst vertices
paths.matrix <- igraph::get.edgelist(mst.paths, names=TRUE)
paths.matrix <- igraph::as_edgelist(mst.paths, names=TRUE)

paths.matrix <- matrix(as.numeric(paths.matrix), ncol = 2)

Expand Down
4 changes: 2 additions & 2 deletions R/shortestPaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ shortestPaths<- function(sim){
#create a list of shortest paths
paths <- unlist(lapply(sim$paths.list,
function(x){
igraph::get.shortest.paths(sim$g, x[1],
igraph::shortest_paths(sim$g, x[1],
x[2], out = "both")
} ))

Expand Down Expand Up @@ -66,7 +66,7 @@ iterativeShortestPaths<- function(sim){

for (i in seq_along(sim$paths.list)) {
path.list <- sim$paths.list[[i]]
path <- igraph::get.shortest.paths(sim$g, path.list[1], path.list[2], out = "both")
path <- igraph::shortest_paths(sim$g, path.list[1], path.list[2], out = "both")

path <- unlist(path)

Expand Down

0 comments on commit f1f845e

Please sign in to comment.