tri_null | R Documentation |
A wrapper function to generate different null models for binary and quantitative tripartite networks
tri_null(
trinet,
null_N = 100,
null_type = c("sauve", "sub_P", "sub_Q", "both_sub"),
sub_method
)
trinet |
An 'igraph' object that represents a tripartite network. |
null_N |
The number of null models to be generated. Default to 100. |
null_type |
Character. Should be one of "sauve","sub_P","sub_Q" and "both_sub".See details. |
sub_method |
The method to shuffle subnetworks. Must be provided when null_type ="sub_P","sub_Q" or "both_sub" . a character specifying the null model algorithm listed on the help page of vegan::commsim. If null_type = 'sauve', it will be ignored. |
In this package, a tripartite network contains three groups of nodes (a-nodes, b-nodes, c-nodes) and two subnetworks (P includes the links between a-nodes and b-nodes, Q includes the links between b-nodes and c-nodes). Connector nodes belong to b-nodes.
null_type
"sub_P", "sub_Q" and "both_sub" use the null model algorithms from vegan::commsim to shuffle single subnetwork or both of them.
"sauve" rearranges connector species without changing subnetworks, following sauve et al.(2016).
Return a list of null models of a tripartite network.
Sauve, A. M., Thebault, E., Pocock, M. J., & Fontaine, C. (2016). How plants connect pollination and herbivory networks and their contribution to community stability. Ecology, 97(4), 908-917.
## generate a random tripartite network
set.seed(12)
Net <- build_toy_net(11,15,16,0.2)
data(PPH_Coltparkmeadow)
Net <- PPH_Coltparkmeadow
set.seed(123)
tri_null_list<-tri_null(Net,null_type="both_sub",sub_method="r00")
set.seed(123)
tri_null_list<-tri_null(Net,null_type="sauve")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.