Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions R/operators.R
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ path <- function(...) {
} else if (is_igraph(e2)) {
## Disjoint union of graphs
res <- disjoint_union(e1, e2)
} else if ("igraph.edge" %in% class(e2)) {
} else if (inherits(e2, "igraph.edge")) {
## Adding edges, possibly with attributes
## Non-named arguments define the edges
if (is.null(names(e2))) {
Expand All @@ -1146,7 +1146,7 @@ path <- function(...) {
attr <- e2[names(e2) != ""]
}
res <- add_edges(e1, as_igraph_vs(e1, toadd), attr = attr)
} else if ("igraph.vertex" %in% class(e2)) {
} else if (inherits(e2, "igraph.vertex")) {
## Adding vertices, possibly with attributes
## If there is a single unnamed argument, that contains the vertex names
named <- rlang::have_name(e2)
Expand All @@ -1160,7 +1160,7 @@ path <- function(...) {

# When adding vertices via +, all unnamed arguments are interpreted as vertex names of the new vertices.
res <- add_vertices(e1, nv = vctrs::vec_size_common(!!!e2), attr = e2)
} else if ("igraph.path" %in% class(e2)) {
} else if (inherits(e2, "igraph.path")) {
## Adding edges along a path, possibly with attributes
## Non-named arguments define the edges
if (is.null(names(e2))) {
Expand Down Expand Up @@ -1247,11 +1247,11 @@ path <- function(...) {
}
if (is_igraph(e2)) {
res <- difference(e1, e2)
} else if ("igraph.vertex" %in% class(e2)) {
} else if (inherits(e2, "igraph.vertex")) {
res <- delete_vertices(e1, unlist(e2, recursive = FALSE))
} else if ("igraph.edge" %in% class(e2)) {
} else if (inherits(e2, "igraph.edge")) {
res <- delete_edges(e1, unlist(e2, recursive = FALSE))
} else if ("igraph.path" %in% class(e2)) {
} else if (inherits(e2, "igraph.path")) {
todel <- unlist(e2, recursive = FALSE)
lt <- length(todel)
if (lt >= 2) {
Expand All @@ -1260,9 +1260,9 @@ path <- function(...) {
} else {
res <- e1
}
} else if ("igraph.vs" %in% class(e2)) {
} else if (inherits(e2, "igraph.vs")) {
res <- delete_vertices(e1, e2)
} else if ("igraph.es" %in% class(e2)) {
} else if (inherits(e2, "igraph.es")) {
res <- delete_edges(e1, e2)
} else if (is.numeric(e2) || is.character(e2)) {
res <- delete_vertices(e1, e2)
Expand Down
Loading