Learn R Programming

brainGraph (version 3.1.0)

make_intersection_brainGraph: Create the intersection of graphs based on a logical condition

Description

Returns a graph object with vertices that meet certain criteria. By default, only vertices that meet these criteria for all input graphs will be retained.

Usage

make_intersection_brainGraph(..., subgraph, keep.all.vertices = FALSE)

Value

An igraph graph object

Arguments

...

Graph objects or lists of graph objects

subgraph

Character string specifying an equation (logical condition) for the vertices to subset

keep.all.vertices

Logical indicating whether to keep all vertices that meet the criteria in at least 1 input graph. Default: FALSE

Author

Christopher G. Watson, cgwatson@bu.edu

Details

If no vertices meet criteria for all input graphs, then an igraph graph object with 0 vertices is returned. If keep.all.vertices=TRUE, this is essentially performing a union of vertex sets that meet the criteria. In any case, the return graph will have 0 edges.

Examples

Run this code
if (FALSE) {
res.mtpc <- mtpc(g, covars, ...)
g.mtpc <- make_glm_brainGraph(res.mtpc, atlas)

## All vertices with a significant MTPC result for all contrasts:
g.mtpc.int <- make_intersection_brainGraph(g.mtpc, subgraph='sig == 1')

## Return graphs with vertices with degree > 0 for each group separately
tapply(g.list, groups(g.list), make_intersection_brainGraph,
       subgraph='degree > 0')
}

Run the code above in your browser using DataLab