mergeEdgeLists: Merge edgelists => Master edgelist => igraph

Description Usage Arguments Examples

Description

This function turns a list of edgelists (data.frames) into a single "master" edgelist. It maintains the edge attributes of each individual edge list

Usage

1
mergeEdgeLists(edgeLists, from = "from.ID", to = "to.ID", keepDups = F)

Arguments

edgeLists

list of edgelists (stored as data.frames)

from

name of the column that specifies the "from" node in each data.frame in edgeLists

to

name of the column that specifies the "to" node in each data.frame in edgeLists

keepDups

deletes duplicate from-to relations when set to FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require('igraph')
cars <- data.frame(mtcars, to=sample(rownames(mtcars), replace=T), from=sample(rownames(mtcars), replace=T))
df1<-cars[sample(1:32,30), c('to', 'from', 'cyl', 'mpg')]
df2<-cars[sample(1:32,15), c('to', 'from', 'cyl', 'qsec')]
df3<-cars[sample(1:32,32), c('to', 'from', 'hp', 'drat')]

df1$cyl[1:10] <- df1$cyl[1:10]+2
el <- list(df1, df2, df3)

mel <- mergeEdgeLists(el, from='from', to='to', keepDups=T)

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.