Learn R Programming

igraph (version 1.3.5)

delete_vertices: Delete vertices from a graph

Description

Delete vertices from a graph

Usage

delete_vertices(graph, v)

Value

The graph, with the vertices removed.

Arguments

graph

The input graph.

v

The vertices to remove, a vertex sequence.

See Also

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

Examples

Run this code
g <- make_ring(10) %>%
  set_vertex_attr("name", value = LETTERS[1:10])
g
V(g)

g2 <- delete_vertices(g, c(1,5)) %>%
  delete_vertices("B")
g2
V(g2)

Run the code above in your browser using DataLab