nullCom: Generate a set of null communities based on functions in the...

Description Usage Arguments Details Value Author(s) Examples

View source: R/nullCom.R

Description

This function produces a set of permuted matrices based on an input species abundance or presence-absence matrix.

Usage

1
nullCom(com, method = "r1", nits = 5000, burn = 500, thin = 10)

Arguments

com

Community matrix with species abundances or presence-absences. Values are converted to presence-absence regardless of input.

method

Permutation method. Options include: r00 = fully random, r0 = maintain site frequencies, r1 = maintain both site and species frequencies. For more options see the oecosimu function in the vegan package.

nits

Number of iterations to conduct.

burn

The number permutations to conduct prior to recording matrices.

thin

The number of discarded matrices between iterations.

Details

Provides high level access to the oecosimu function in vegan.

Value

Returns a set of permuted matrices to be used for null modeling. The default null model is the most constrained version (i.e. both species and observation marginal totals are restricted).

Author(s)

Matthew K. Lau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (com, method = "r1", nits = 5000, burn = 500, thin = 10) 
{
    com[com != 0] <- 1
    for (i in 1:burn) {
        post.burn <- commsimulator(x = com, method = method, 
            thin = thin)
    }
    out <- list()
    for (i in 1:nits) {
        out[[i]] <- commsimulator(x = post.burn, method = method, 
            thin = thin)
    }
    return(out)
  }

ECGen/ComGenR documentation built on July 23, 2021, 11:44 p.m.