Description Usage Arguments Value Examples
View source: R/graph_to_adjlist.R
An "adjacency list" is similar to an edgelist, in that every row encodes the relationship between two nodes. However, an edgelist will typically contain only non-zero relationships.
On the other hand, in an adjlist, we are explicitly interested in maintaining a full list of all possible pairwise relationships.
Beware combinatorical explosion for large graphs.
1 | graph_to_adjlist(input_tidygraph)
|
input_tidygraph |
A 'tbl_graph' representation from 'tidygraph'. This function will not work with other kinds of network representations, e.g. from 'igraph'. Make sure that your input graph is either directed or undirected, as you'd like it. |
A tibble containing as many observations as there are cells in an NxN matrix, where N=number of nodes.
1 2 3 4 | `%>%` <- magrittr::`%>%`
successr::karate %>%
tidygraph::as_tbl_graph(directed = F) %>%
graph_to_adjlist()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.