nvertices | R Documentation |
Retrieve the number of vertices in a neighbor_graph object.
nvertices(x, ...)
x |
an object with a neighborhood |
... |
Additional arguments (currently ignored). |
The number of vertices in the neighbor_graph object.
# Create a small example graph
adj_matrix <- matrix(c(0, 1, 1, 0, 1, 0, 1, 0, 0), nrow = 3, byrow = TRUE)
ng <- neighbor_graph(adj_matrix)
nvertices(ng) # Should return 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.