df2tri | R Documentation |
transforms (wide) 'dataframe' into (long) edgelists to work with 'igraph'
df2tri(df, node_columns, edge_columns)
df |
the dataframe |
node_columns |
node-columns as vector |
edge_columns |
edge-columns as vector. First edge-column should equal edge-weight |
code based on function 'df2nmode' from mardyR package
returns edgelist
## Not run:
df <- data.frame(from = 1:4,
to = c("a", "b", "b", "a"),
frame = paste0("f", 4:1),
time = paste0("t", c(1,1,2,2)),
weight = 1,
stringsAsFactors = FALSE)
df2tri(df, node_columns = 1:4, edge_columns = 5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.