add_vertices | R Documentation |
Add vertices to graph
add_vertices(graph_id, vertices, vertex_id_col = 1L)
graph_id |
the graph to which to add the edges and vertices. Should
be of type |
vertices |
a data.frame or vector with vertices. By default it is assumed that
the first column of the data.frame contains the vertex id's (see |
vertex_id_col |
name or number of the column from |
Note that the original graph_id
is modified.
Modifies graph_id
and returns graph_id
.
# Create a graph with 4 vertices without edges g <- create_graph() g <- add_vertices(g, data.frame(id = c(1,2,3,4))) print(g) delete_graph(g)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.