diff --git a/R/manip_reformed.R b/R/manip_reformed.R index e3144dc8..954d7f7f 100644 --- a/R/manip_reformed.R +++ b/R/manip_reformed.R @@ -594,8 +594,10 @@ to_matching.igraph <- function(.data, mark = "type", capacities = NULL){ el <- igraph::max_bipartite_match(.data, types = node_attribute(.data, mark))$matching el <- data.frame(from = names(el), to = el) - out <- suppressWarnings(as_igraph(el, twomode = TRUE)) - out <- igraph::delete_vertices(out, "NA") + el$from[is.na(el$from)] <- "dummy" + el$to[is.na(el$to)] <- "dummy" + out <- as_igraph(el, twomode = TRUE) + out <- igraph::delete_vertices(out, "dummy") out <- to_twomode(out, node_attribute(.data, mark)) } else { if(length(capacities) == 1)