Thresholds a connectivity matrix to achieve a target network density.
Examples
set.seed(123)
pe <- PhysioExperiment(
assays = list(raw = matrix(rnorm(500 * 4), nrow = 500, ncol = 4)),
samplingRate = 100
)
conn <- correlationMatrix(pe)
# Keep top 30% of connections
adj <- thresholdNetwork(conn, density = 0.3)