Description Usage Arguments Value Examples
View source: R/encode_together.r
The only difference with igraph::graph_from_data_frame is that
this returns an 0/1 adjacency matrix and sorts whatever attributes were
passed via data
accordingly to the network coding.
1 2 3 |
edgelist |
A data.frame. Only the first two columns will be used. |
data |
A data.frame with vertex attributes. |
data.idvar |
Character scalar. Name of the variable that holds the vertex id (label). By default it uses the first column. |
A list with the following
adjmat |
A matrix of n\times n. |
data |
A sorted version of |
1 2 3 4 5 6 | # Simple example
net <- c("a", "b", "a", "c", "b", "c", "c", "b", "c", "a")
net <- matrix(net, byrow = TRUE, ncol=2)
dat <- data.frame(name = c("d", "a", "c", "b"), age = c(4, 1, 3, 2))
ans0 <- edgelist_to_adjmat_w_attributes(net, dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.