从图中删除顶点
参见
用于操作图结构的其他函数:+.igraph()
, add_edges()
, add_vertices()
, complementer()
, compose()
, connect()
, contract()
, delete_edges()
, difference()
, difference.igraph()
, disjoint_union()
, edge()
, igraph-minus
, intersection()
, intersection.igraph()
, path()
, permute()
, rep.igraph()
, reverse_edges()
, simplify()
, union()
, union.igraph()
, vertex()
示例
g <- make_ring(10) %>%
set_vertex_attr("name", value = LETTERS[1:10])
g
#> IGRAPH 46387a8 UN-- 10 10 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l), name (v/c)
#> + edges from 46387a8 (vertex names):
#> [1] A--B B--C C--D D--E E--F F--G G--H H--I I--J A--J
V(g)
#> + 10/10 vertices, named, from 46387a8:
#> [1] A B C D E F G H I J
g2 <- delete_vertices(g, c(1, 5)) %>%
delete_vertices("B")
g2
#> IGRAPH fafee7b UN-- 7 5 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l), name (v/c)
#> + edges from fafee7b (vertex names):
#> [1] C--D F--G G--H H--I I--J
V(g2)
#> + 7/7 vertices, named, from fafee7b:
#> [1] C D F G H I J