netIntersect: Network Intersection

Description Usage Arguments Details Value Author(s) Examples

View source: R/netIntersect.R

Description

Returns the intersection of the input matrices. Output object is an adjacency matrix where the edge weight is the average value of the absolute value of edges in BOTH matrices. Edges not present in either, or below the cutoff are removed or set to zero.

Usage

1
netIntersect(matrix1, matrix2, cutoff=NULL, absolute=TRUE, ...)

Arguments

matrix1

Square matrix (e.g. correlation or adjacency) containing row/column labels

matrix2

Square matrix (e.g. correlation or adjacency) containing row/column labels

cutoff

The cutoff value. Edges less than this value (absolute value considered)are converted to zero.

absolute

Logical, should the absolute values be considered for the cutoff value.

...

Other parameters.

Details

Matrices must be square and have row and column labels. Output adjacency matrix can be used directly for creating a graph object.

Value

netIntersect returns an adjacency matrix containing edged present in both graphs.

Author(s)

Shannon M. Bell

Examples

1
2
3
4
5
6
7
8
 #using the state.x77 and USArrests datasets
 arrestCor<-cor(t(USArrests))
 stateCor<-cor(t(state.x77))
 isect<-netIntersect(stateCor, arrestCor)
 isect[1:15,1:5]
 #Setting a cutoff to remove any edges that are below 0.6 
 isect.6<-netIntersect(stateCor, arrestCor, cutoff=0.6)
 isect.6[1:15,1:5]

NetComp documentation built on May 2, 2019, 8:15 a.m.