Learn R Programming

backbone (version 1.1.0)

universal: Compute universal threshold backbone

Description

`universal` returns a unipartite backbone matrix in which values are set to 1 if above the given upper parameter threshold, and set to -1 if below the given lower parameter threshold, and are 0 otherwise.

Usage

universal(M, upper = 0, lower = NULL, bipartite = FALSE)

Arguments

M

Matrix: a weighted adjacency matrix or a bipartite adjacency matrix.

upper

Real or FUN: upper threshold value or function to be applied to the edge weights. Default is 0.

lower

Real or FUN: lower threshold value or function to be applied to the edge weights. Default is NULL.

bipartite

Boolean: TRUE if bipartite matrix, FALSE if weighted matrix. Default is FALSE.

Value

list(backbone, summary). backbone: a matrix, Signed (or positive) adjacency matrix of backbone summary: a data frame summary of the inputted matrix and the model used including: model name, number of rows, skew of row sums, number of columns, skew of column sums, and running time.

Examples

Run this code
# NOT RUN {
test <- universal(davis%*%t(davis), upper = function(x)mean(x)+sd(x), lower=function(x)mean(x))
test2 <- universal(davis, upper = function(x)mean(x)+2*sd(x), lower = 2, bipartite = TRUE)
test3 <- universal(davis, upper = 4, lower = 2, bipartite = TRUE)
# }

Run the code above in your browser using DataLab