tax.sim: Simluating taxonomic data based upon a set correlation...

Description Usage Arguments Examples

View source: R/datasim_main.R

Description

This function takes certain parameters and returns an appropriate count-data matrix with a zero-inflated negative binomial distribution. The function takes into account a pre-specified correlation structure (exchangable or phylogenetic) and simulate data accordingly. Phylogenetic correlation structure also comes with tree and correlation extracted from the tree.

Usage

1
2
tax.sim(n.spec, corr.struc, n.samp, p = 0.1, rho = NULL, phi = NULL,
  mu = NULL)

Arguments

n.spec

Number of taxa in the community

corr.struc

Correlation structure. Can be "ex" for exchangable or "phylo" for phylogenetic (comes with tree)

n.samp

Number of samples

p

Probability of zero

rho

If corr.struc = "ex", then a correlation parameter is required.

phi

Dispersion parameter. From real data, the values are between 0.001 and 0.02.

mu

Mean parameter. From real data, the values are between 5 and 35.

Examples

1
2
3
4
    tax <- tax.sim(n.spec = 20, n.samp = 200,
                     corr.struc = "phylo", p = 0.1)
    plot(tax$tree) #getting the tree
    head(tax$abundance) #the relative abundance

quangnguyen1995/MCTools documentation built on May 23, 2019, 8:56 a.m.