R/chao1.R

Defines functions `chao1`

`chao1` <-
function(x,taxa.row=TRUE) {
  if (taxa.row==FALSE) x<-t(x)
  if (ncol(as.matrix(x))==1 || nrow(as.matrix(x))==1) ch<-(int.chao(x))
  else {ch<-int.chao(rowSums(x)) 
  if (sum(x[x>1])==0) warning("This data appears to be presence/absence based, but this estimator is for abundance data only")
    }
return(ch)
}

Try the fossil package in your browser

Any scripts or data that you put into this service are public.

fossil documentation built on March 23, 2020, 5:06 p.m.