spec.gen: Specialist/Generalist classification of OTUs based on niche...

Description Usage Arguments Details Value Author(s) Examples

View source: R/EcolUtils_functions.R

Description

Classification of OTUs in generalists / specialists / non-significant based on the deviation of niche width indexes (shanon, levins or occurrence) from null values computed with permutation algorithms for community matrices.

Usage

1
2
spec.gen(comm.tab, niche.width.method = "levins", perm.method = "quasiswap",
  n = 1000, probs = c(0.025, 0.975))

Arguments

comm.tab

Community data, a matrix-like object (samples as rows; OTUs as columns).

niche.width.method

Niche width index (from niche.width in spaa): levins (default) or shannon. Or simply the occurrence: the number of samples where an OTU occurs.

perm.method

Method for null model construction (from permatswap in vegan). Currently, only quasiswap (default) has been thoroughly tested.

n

Number of permutations.

probs

Probabilities for confidence interval calculations.

Details

Basically the spec.gen function computes a niche width index for each OTU in the comm.tab. The mean index value and CI for each OTU is computed for n null matrices created through permutation algorithms. Each OTU is classified as specialist / generalist / non significant if the real value is lower / higher / within the CI.

Value

Data frame with the observed niche width value, the mean and CI null values and the classification of each OTU.

Author(s)

Guillem Salazar <guillems@ethz.ch>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(RCurl)
x<-getURL("https://raw.githubusercontent.com/GuillemSalazar/MolEcol_2015/master/OTUtable_Salazar_etal_2015_Molecol.txt")
comm.tab<-read.table(text=x,sep="\t",row.names=1,header=TRUE,comment.char="@")
comm.tab<-t(comm.tab[,1:60])
comm.tab<-comm.tab[,which(colSums(comm.tab)>0)]
res<-spec.gen(comm.tab,n=100)

comm.tab.bin<-ceiling(comm.tab/max(comm.tab))
plot(colSums(comm.tab),colSums(comm.tab.bin)/dim(comm.tab.bin)[1],col=res$sign,pch=19,log="x",xlab="Abundance",ylab="Occurrence")
legend("bottomright",levels(res$sign),col=1:3,pch=19,inset=0.01,cex=0.7)

GuillemSalazar/EcolUtils documentation built on Nov. 6, 2019, 10:50 a.m.