Learn R Programming

XGR (version 1.1.7)

xCombineNet: Function to combine networks from a list of igraph objects

Description

xCombineNet is supposed to combine networks from a list of igraph objects.

Usage

xCombineNet(
list_ig,
combineBy = c("union", "intersect"),
attrBy = c("intersect", "union"),
keep.all.vertices = FALSE,
verbose = TRUE
)

Arguments

list_ig

a list of "igraph" objects or a "igraph" object

combineBy

how to resolve edges from a list of "igraph" objects. It can be "intersect" for intersecting edges and "union" for unionising edges (by default)

attrBy

the method used to extract node attributes. It can be "intersect" for intersecting node attributes (by default) and "union" for unionising node attributes

keep.all.vertices

logical to indicate whether all nodes are kept when intersecting edges. By default, it sets to false

verbose

logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display

Value

an object of class "igraph"

See Also

xDefineNet

Examples

Run this code
# NOT RUN {
# Load the library
library(XGR)
# }
# NOT RUN {
RData.location <- "http://galahad.well.ox.ac.uk/bigdata"
# }
# NOT RUN {
g1 <- xDefineNet(network="KEGG_environmental",
RData.location=RData.location)
g2 <- xDefineNet(network="KEGG_organismal",
RData.location=RData.location)
ls_ig <- list(g1, g2)
ig <- xCombineNet(ls_ig, combineBy='union', attrBy="intersect",
verbose=TRUE)
# }

Run the code above in your browser using DataLab