review | R Documentation |
igraph
network statisticsProcesses a dataframe (and edgelist) by adding network statistics and producing a nodelist and an igraph
graph object for use in subsequent analysis.
review(data, edge_attributes = NULL, node_attributes = NULL, from = "from", to = "to", node = "node")
data |
a data set with a "from" column and a "to" column, where each row represents a directed edge. (See the |
edge_attributes |
an optional character vector of the names of columns in |
node_attributes |
an optional data frame with columns "node" as well as any node attributes. Node attribute names may not be the same as any edge attribute names. See |
from |
the name of the column in |
to |
the name of the column in |
node |
the name of the column in |
review()
performs the tasks of make_edgelist
, make_nodelist
, and augment_nodelist
all in one step. First, it creates a pared down version of data
containing only the from
, to
, and edge_attributes
columns, and an added "edge_betweenness"
column containing edge betweennesses as produced by igraph::edge_betweenness()
. Next, it creates a node list by merging the attrbiutes
with the unique nodes present in data
. Next, it augments the node list by adding a "degree"
column resulting from igraph::degree
with mode = "in"
and a "betweenness"
column resulting from igraph::betweenness
. Finally, it produces a graph from the edge list and node list using igraph::graph_from_data_frame
.
All but the last step can be performed individually using the netlit functions mentioned above.
A netlit_review
object, which contains three elements:
edgelist |
an edge list with the selected edge attributes and the |
nodelist |
a node list with the included node attributes and the |
graph |
an |
There is a print
method that reports some basic summaries of the object.
make_edgelist
, make_nodelist
, augment_nodelist
igraph::graph_from_data_frame
data("literature") lit <- review(literature) lit data("node_attributes") lit <- review(literature, edge_attributes = c("cites", "cites_empirical"), node_attributes = node_attributes) lit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.