Skip to content

Commit

Permalink
Merge pull request #75 from krlmlr/b-74-dev-igraph
Browse files Browse the repository at this point in the history
fix: Fix `fortify()` for the upcoming igraph version
  • Loading branch information
briatte authored Nov 22, 2023
2 parents 5b6ed24 + 5d715d2 commit c37c3d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/fortify-igraph.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ fortify.igraph <- function(
...
) {
# node placement
if (inherits(layout, "matrix") && identical(dim(layout), c(igraph::gorder(model), 2L))) {
nodes <- layout[, 1:2 ]
} else if (inherits(layout, "matrix")) {
stop("layout matrix dimensions do not match network size")
if (inherits(layout, "matrix")) {
if (nrow(layout) != igraph::gorder(model)) {
stop("layout matrix dimensions do not match network size")
}
nodes <- layout[, 1:2]
} else {
nodes <- igraph::layout_(model, layout, ...)
}
Expand Down

0 comments on commit c37c3d4

Please sign in to comment.