getNodesDataFrame: Create Nodes 'data.frame' from Adjacency matrix and...

Description Usage Arguments Value Author(s) Examples

View source: R/dataformating.R

Description

Create Nodes data.frame from Adjacency matrix and properties for specific nodes

Usage

1
getNodesDataFrame(A, nGlobal = NULL, nProp = NULL)

Arguments

A

signed weighted adjacency matrix

nGlobal

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

nProp

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
10
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]
nGlobal <- list(color="#dedeff")
nProp <- data.frame(shape=c('triangle', 'lozenge'))
rownames(nProp) <- c('C', 'E')
getNodesDataFrame(A=a, nGlobal=nGlobal, nProp=nProp)

RGraph2js documentation built on Nov. 8, 2020, 8:17 p.m.