Description Usage Arguments Value Examples
View source: R/adjlist_to_matrix.R
An adjacency contains NxN observations that can be alternatively represented as an NxN square matrix. This function performs that conversion.
1 | adjlist_to_matrix(input_df)
|
input_df |
A tibble with NxN observations, such that every row is a pairwise combination of two nodes ('from' and 'to'), and a column called 'edge' encodes whether there is a relationship between them. |
A square NxN matrix, where N=number of nodes.
1 2 3 4 5 | `%>%` <- magrittr::`%>%`
successr::karate %>%
tidygraph::as_tbl_graph(directed = F) %>%
graph_to_adjlist() %>%
adjlist_to_matrix()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.