Create Edges data.frame from Adjacency matrix and properties

Share:

Description

Create Edges data.frame from Adjacency matrix and properties

Usage

1
getEdgesDataFrame(A, eGlobal = NULL, eProp = NULL)

Arguments

A

signed weighted adjacency matrix

eGlobal

A list of properties for assigning all edges. Default value is NULL

eProp

A data.frame for assigning some nodes properties Default value is NULL

Value

A data.frame

Author(s)

Sylvain Gubian DL.RSupport@pmi.com

Examples

1
2
3
4
5
6
7
8
9
v <- c(0, 0, 1, 1, 0,
       0, 0, 0, 0, 0,
      -1, 0, 0, 1, 0)
a <- matrix(v, 3, 5)
colnames(a) <- LETTERS[1:5]
rownames(a) <- LETTERS[1:3]
eGlobal <- list(color="#5555ff")
eProp <- data.frame(from=c('A','C'), to=c('B', 'A'), width=c(2,2))
getEdgesDataFrame(A=a, eGlobal=eGlobal, eProp=eProp)