tri_null: Generates null models for tripartite network

View source: R/tri_null.R

tri_nullR Documentation

Generates null models for tripartite network

Description

A wrapper function to generate different null models for binary and quantitative tripartite networks

Usage

tri_null(
  trinet,
  null_N = 100,
  null_type = c("sauve", "sub_P", "sub_Q", "both_sub"),
  sub_method
)

Arguments

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.

Details

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).

Value

Return a list of null models of a tripartite network.

References

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.

Examples


## 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")

ILSM documentation built on Aug. 8, 2025, 7:42 p.m.