| add_nodes | R Documentation |
Add Nodes to a Network
add_nodes(x, labels, ..., keep_format = FALSE, directed = NULL)
x |
Network input. |
labels |
Character vector of labels for the new nodes. |
... |
Named vectors of node attributes for the new nodes, each of
length 1 (recycled) or |
keep_format |
Logical. Return the input format when TRUE. |
directed |
Logical or NULL. If NULL (default), auto-detect. |
A cograph_network with the new nodes appended (isolated until
edges are added), or the input format when keep_format = TRUE.
remove_nodes, add_edges,
mutate_nodes
adj <- matrix(c(0, 1, 1, 0), 2, 2)
rownames(adj) <- colnames(adj) <- c("A", "B")
add_nodes(adj, labels = c("C", "D"))
add_nodes(adj, labels = "C", group = "new")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.