Learn R Programming

cograph (version 2.7.2)

remove_edges: Remove Edges from a Network

Description

Remove Edges from a Network

Usage

remove_edges(
  x,
  from,
  to,
  keep_isolates = TRUE,
  keep_format = FALSE,
  directed = NULL
)

Value

A cograph_network without those edges, or the input format when keep_format = TRUE. Named pairs that carry no edge are reported in a cograph_no_such_edge warning.

Arguments

x

Network input.

from

Source nodes, by label or index.

to

Target nodes, by label or index. The same length as from.

keep_isolates

Logical. Keep nodes that end up with no edges? Default TRUE, matching filter_edges.

keep_format

Logical. Return the input format when TRUE.

directed

Logical or NULL. If NULL (default), auto-detect.

See Also

add_edges, filter_edges, remove_isolates

Examples

Run this code
adj <- matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")

remove_edges(adj, from = "A", to = "B")

Run the code above in your browser using DataLab