Binary.matrix.by.thresh-methods | R Documentation |
Methods to transform a a real-valued network matrix into a binary matrix. The binary matrix is obtained by thresholding: values above the given threshold are set to 1, otherwise to 0
Binary.matrix.by.thresh(W, thresh=0.5)
W |
an object representing the graph to be normalized |
thresh |
the threshold (def.=0.5) |
The normalized binary adjacency matrix of the network
signature(W = "graph")
an object of the virtual class graph (hence including objects of class graphAM
and graphNEL
from the package graph)
signature(W = "matrix")
a matrix representing the adjacency matrix of the graph
library(bionetdata); data(DD.chem.data); W <- Binary.matrix.by.thresh(DD.chem.data); # Using both methods with both signatures "matrix" and "graph" # reducing dimension of the graph library(graph); DD.chem.data.red <- DD.chem.data[1:100,1:100]; W.red <- Binary.matrix.by.thresh(DD.chem.data.red); g <- new("graphAM", adjMat=DD.chem.data.red, values=list(weight=DD.chem.data.red)); Wg <- Binary.matrix.by.thresh(g); any(W.red!=Wg);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.