View source: R/augment_nodelist.R
| augment_nodelist | R Documentation |
augment_nodelist() augments the supplied node list by adding graph-based measures as node attributes.
augment_nodelist(nodelist, edgelist = NULL, graph = NULL)
nodelist |
a |
edgelist |
optional; an |
graph |
an |
When edgelist or graph are supplied, the "degree" node attribute is added, resulting from igraph::degree(graph, mode = "in"). (If graph is not supplied but edgelist is, igraph::graph_from_data_frame() will be run on edgelist first.) In any case, the "betweenness" attribute is added, resulting from igraph::betweenness.
The argument supplied to ndoelist with one or two columns added. When edgelist or graph are supplied, the "degree" column is added. In any case, the "betweenness" column is added.
review, make_edgelist, make_nodelist
data("literature")
data("node_attributes")
nodelist <- make_nodelist(literature,
node_attributes = node_attributes)
edgelist <- make_edgelist(literature,
edge_attributes = c("cites", "cites_empirical"))
nodelist_augmented <- augment_nodelist(nodelist,
edgelist = edgelist)
str(nodelist_augmented)
## Not run:
#Same results:
graph <- igraph::graph_frm_data_from(edgelist)
nodelist_augmented <- augment_nodelist(nodelist,
graph = graph)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.