Learn R Programming

igraph (version 1.3.5)

delete_edges: Delete edges from a graph

Description

Delete edges from a graph

Usage

delete_edges(graph, edges)

Value

The graph, with the edges removed.

Arguments

graph

The input graph.

edges

The edges to remove, specified as an edge sequence. Typically this is either a numeric vector containing edge IDs, or a character vector containing the IDs or names of the source and target vertices, separated by |

See Also

Other functions for manipulating graph structure: +.igraph(), add_edges(), add_vertices(), delete_vertices(), edge(), igraph-minus, path(), vertex()

Examples

Run this code
g <- make_ring(10) %>%
  delete_edges(seq(1, 9, by = 2))
g

g <- make_ring(10) %>%
  delete_edges("10|1")
g

g <- make_ring(5)
g <- delete_edges(g, get.edge.ids(g, c(1,5, 4,5)))
g

Run the code above in your browser using DataLab