Description Usage Arguments Value Examples
View source: R/unfolded_temporal_nets.R
Create time unfolded adjacency matrix
1 2 3 4 5 6 7 8 |
edge.list |
data.frame or tibble containing the edge list. It needs at least three column: the column with edge sources, the edge targets, and the timestamps of each edge. The order of columns should be 'timestamp', 'source', 'target'. If the edge.list columns come in different orders, use 'select_cols' to specify the right order. See the example for details. |
select_cols |
optional vector of 3 (2 for multi-graphs) elements
specifying which columns are the source,target, and attributes from which
building the graph. Otherwise Column 1 is assumed to be the source, column
2 the target, column 3 the attribute. In the case of multi-graphs, the
third element is not needed and the number of edges between each pair of
vertices is computed according to ' |
nodes |
optional vector containing all node names in case disconnected nodes should be included. |
vertical |
unfold vertically or horizontally? Defaults to FALSE (horizontal) |
sparse |
boolean, return sparse matrix? default to TRUE |
... |
extra parameters passed to internal methods |
The time unfolded (nodes x timestamps) x (nodes x timestamps) adjacency matrix. The node order follows the vertical or horizontal algnment
1 2 3 4 5 6 | el <- data.frame(
from = c('A','B', 'A','B','B', 'A','C','C', 'A','B','C', 'D'),
to = c('C','C', 'C','C','D', 'C','D','E', 'C','C','E', 'E'),
ts = c( 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 6)
)
get_unfolded_adjacency(el, select_cols = 1:3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.