# \donttest{
{
### Data preparation ###
data(testotu)
rownames(testotu) <- testotu[, 1]
inputotu <- testotu[, -c(1, ncol(testotu))]
head(inputotu)
set.seed(999)
### One input network analysis ###
network_result <- network_analysis2(
inputotu,
3,
10,
0.9,
"spearman",
TRUE
)
# Nodes information table
network_nodes <- network_result$Nodes_info
head(network_nodes)
# Adjacency table
network_adjacency <- network_result$Adjacency_column_table
head(network_adjacency)
# Complete adjacency matrix
network_matrix <- network_result$Adjacency_matrix
print(network_matrix[1:10, 1:10])
# igraph object
igraph_object <- network_result$Igraph_object
network_stat(igraph_object) # In case you want to see statistics again
# or do other analysis based on igraph.
### Two inputs network analysis ###
inputotu1 <- inputotu[1:456, ]
inputotu2 <- inputotu[524:975, ]
network_result <- network_analysis2(
input = inputotu1,
inputtype = 3,
input2 = inputotu2,
input2type = 3,
n = 10,
threshold = 0.85,
method = "spearman",
display = TRUE
)
#### Incorrect demonstration !! ###
{
network_result <- network_analysis2(inputotu, 3, 3, 0.8, "spearman", TRUE)
}
# Total edges/links: 10199
# Total vertices: 826
# Too many edges and not a global network
}
# }
Run the code above in your browser using DataLab