ab.assign | R Documentation |

This funciton is to assign abundances to species when randomizing communities based on null models considering abundances. Individuals are randomly drawn into species according to the specified probabilities.

ab.assign(comm.b, samp.ab=NULL, prob.ab)

`comm.b` |
numeric matrix, binary (present/absent) community data, rownames are sample/site names, colnames are species names. |

`samp.ab` |
numeric vector, total abundances (total individual numbers) in each sample. If samp.ab=NULL, Dirichlet distribution will be used to generate randomized community matrix with relative abundance (proportion) of each taxon in each sample. |

`prob.ab` |
numeric matrix, probability of each species into which the individuals in a certain sample are drawn. |

This function is called by the function `taxo.null`

to generate randomized communities.

A matrix of community data with abundances (or relative abundance) is returned. rownames are sample/site names, and colnames are species names.

Version 3: 2021.7.27, debug, if samp.ab is lower than samp.rich, no need to assign abundance. Version 2: 2021.4.16, add new algorithm based on Dirichlet distribution. Version 1: 2015.10.22.

Daliang Ning

Stegen JC, Lin X, Fredrickson JK, Chen X, Kennedy DW, Murray CJ, Rockhold ML, and Konopka A. Quantifying community assembly processes and identifying features that impose them. Isme Journal 7, 2069-2079 (2013).

`taxo.null`

data(tda) comm=tda$comm comm.b=comm comm.b[comm.b>0]=1 samp.ab=rowSums(comm) prob.ab=matrix(colSums(comm),nrow=nrow(comm),ncol=ncol(comm),byrow=TRUE) comm.rand=ab.assign(comm.b,samp.ab,prob.ab)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.