Description Usage Arguments Value Author(s) Examples
View source: R/threshold_matrix.R
This function is used to threshold a correlation matrix in order to prune weak connections.
1 | threshold_matrix(c, q.thresh = 0.9, thresh)
|
c |
The network either as connectivity matrix or as an igraph object. |
q.thresh |
The quantile to threshold. Defaults to .90, such that all below the 90th quantile are set to zero. |
thresh |
The number (taken to be an absolute value) below which to threshold (ie, correlation or cohen's d , etc). No default. Recommend .10 for correlation or .20 for cohen's d. |
The pruned correlation matrix.
Brandon Vaughan
1 2 3 | threshold_matrix(matrix, q=.90) # This should threshold such that only positive values are returned.
threshold_matrix(abs(matrix), q=.90) # Taking the absolute value of the matrix will allow negative correlations sufficiently strong to be included as an edge. This does not preserve signs.
threshold_matrix(abs(matrix), q=.90)*sign(matrix) This will restore the signs after thresholding if desired.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.