This is a helper function that simplifies adding and deleting vertices to/from graphs.
Value
A special object that can be used with together with igraph graphs and the plus and minus operators.
Details
vertices() is an alias for vertex().
When adding vertices via +, all unnamed arguments are interpreted
as vertex names of the new vertices. Named arguments are interpreted as
vertex attributes for the new vertices.
When deleting vertices via -, all arguments of vertex() (or
vertices()) are concatenated via c() and passed to
delete_vertices().
See also
Other functions for manipulating graph structure:
+.igraph(),
add_edges(),
add_vertices(),
complementer(),
compose(),
connect(),
contract(),
delete_edges(),
delete_vertices(),
difference(),
difference.igraph(),
disjoint_union(),
edge(),
igraph-minus,
intersection(),
intersection.igraph(),
path(),
permute(),
rep.igraph(),
reverse_edges(),
simplify(),
transitive_closure(),
union(),
union.igraph()
Examples
g <- make_(ring(10), with_vertex_(name = LETTERS[1:10])) +
vertices("X", "Y")
g
#> ── <igraph> Ring graph ────────────────────────────────────────────── 7796dfb ──
#> ℹ undirected · named
#> ℹ 12 vertices · 10 edges
#>
#> ── Attributes ──────────────────────────────────────────────────────────────────
#> → graph: name <chr>, mutual <lgl>, circular <lgl>
#> → vertex: name <chr>
#>
#> ── Edges (vertex names) ────────────────────────────────────────────────────────
#> [1] A ─ B B ─ C C ─ D D ─ E E ─ F F ─ G G ─ H H ─ I I ─ J A ─ J
plot(g)
