MergeEdgelists: Combine edgelists into a single data.frame

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/MergeEdgelists.R

Description

Given two or more edgelists, create a single edgelist with multiple columns, two for the from and to nodes and one for the weights from each constituent network.

Usage

1

Arguments

...

data.frames, edgelists to be merged.

Value

data.frame, single multinetwork edgelist

Author(s)

Stephen R. Haptonstahl srh@haptonstahl.org

References

http://www.haptonstahl.org/R

See Also

EdgelistFill

Examples

1
2
3
4
edgelist1 <- data.frame(expand.grid(letters[1:2], letters[1:2]),
                        uniform=runif(4))
edgelist2 <- data.frame(v1=c("a", "a"), v2=c("a", "b"), manual=c(.3, .5))
MergeEdgelists(edgelist1, edgelist2)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: Rcpp
  Var1 Var2   uniform    manual
1    a    a 0.5449277 0.5449277
2    a    b 0.7949811 0.7949811
3    b    a 0.6681833 0.6681833
4    b    b 0.5389593 0.5389593

dils documentation built on May 2, 2019, 8:28 a.m.