NC_remove | R Documentation |
Natural connectivity analysis
NC_remove(input, num, seed = 1)
input |
Network adjacency matrix. Can be generated by |
num |
Max number of removed nodes. Default: Automatically match max number that can be removed. |
seed |
Random seed Number to be set. Default: 1. See in |
NC_remove returns data frame with removed nodes and corresponding natural connectivity
Wang Ningqi2434066068@qq.com
{
### Data preparation ###
data("Two_group")
### One input network analysis ###
network_results <- network_analysis(
taxobj = Two_group,
taxlevel = "Base",
reads = FALSE,
n = 10,
threshold = 0.6
)
network_matrix <- as.data.frame(network_results[[3]]) # Complete adjacency matrix
# Check initial natural connectivity
nc <- nc(network_matrix)
# Conduct natural connectivity analysis
nc_remove <- NC_remove(input = network_matrix)
head(nc_remove)
tail(nc_remove)
# Set target number for natural connectivity analysis
nc_remove <- NC_remove(input = network_matrix, num = 400)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.