powered by
Remove Nodes from a Network
remove_nodes(x, nodes, keep_format = FALSE, directed = NULL)
A cograph_network without those nodes and without any edge that touched them, or the input format when keep_format = TRUE.
cograph_network
keep_format = TRUE
Network input.
Node labels or indices to remove.
Logical. Return the input format when TRUE.
Logical or NULL. If NULL (default), auto-detect.
add_nodes, filter_nodes, remove_isolates
add_nodes
filter_nodes
remove_isolates
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3) rownames(adj) <- colnames(adj) <- c("A", "B", "C") remove_nodes(adj, nodes = "B")
Run the code above in your browser using DataLab