checkCDM: Confirm that a CDM will run

Description Usage Arguments Details Value References Examples

View source: R/checkCDM.R

Description

Check that a CDM will work with the dispersalNull model.

Usage

1
checkCDM(picante.cdm)

Arguments

picante.cdm

A picante-style community data matrix with sites as rows, and species as columns

Details

It is possible that a CDM is unsuitable for the dispersalNull model. Specifically, if any single grid cell contains more species than are contained in the sum of the remaining grid cells, the model will get stuck in an indefinite loop.

Value

either "pass" or "fail"

References

Miller, E. T., D. R. Farine, and C. H. Trisos. 2016. Phylogenetic community structure metrics and null models: a review with new methods and software. Ecography DOI: 10.1111/ecog.02070

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#simulate tree with birth-death process
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)

sim.abundances <- round(rlnorm(5000, meanlog=2, sdlog=1)) + 1

cdm <- simulateComm(tree, richness.vector=10:25, abundances=sim.abundances)

#this CDM should pass the check
checkCDM(cdm)

#this CDM should not pass the check
test <- matrix(nrow=3, ncol=10)
test[1,] <- 1:10
test[2,] <- c(1,1,0,0,0,0,0,0,0,0)
test[3,] <- c(1,1,0,0,0,0,0,0,0,0)
test <- as.data.frame(test)
names(test)<-paste("s",1:10, sep="")
row.names(test) <- c("cell1","cell2","cell3")
checkCDM(test)

metricTester documentation built on Dec. 16, 2019, 1:20 a.m.