From f08690d79eeea6f564576cad6fa890d409eebe7d Mon Sep 17 00:00:00 2001 From: Vadim Nazarov Date: Fri, 3 Apr 2015 17:03:07 +0300 Subject: [PATCH] add fix for chao1 function --- R/diversity.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/diversity.R b/R/diversity.R index a7877e1..3eff888 100644 --- a/R/diversity.R +++ b/R/diversity.R @@ -119,7 +119,7 @@ chao1 <- function (.data) { # f1 != && f2 != 0 else { const <- (n - 1) / n - e <- D + f1^2 / (2 * f1) * const + e <- D + f1^2 / (2 * f2) * const f12 <- f1 / f2 v <- f2 * (const * f12^2 / 2 + const^2 * f12^3 + const^2 * f12^4 / 4) t <- e - D