nc | R Documentation |
Calculate Network Natural Connectivity
nc(adj_matrix)
adj_matrix |
Adjacency data frame or matrix. Can be calculated from |
Numeric value of natural connectivity
{
### 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
)
# Convert network results to a data frame for the adjacency matrix
network_matrix <- as.data.frame(network_results[[3]]) # Complete adjacency matrix
# Check initial natural connectivity
nc_initial <- nc(network_matrix)
print(nc_initial) # Print the initial natural connectivity
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.