[Vegan-commits] r264 - in pkg: R inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 18 14:38:36 CET 2008


Author: jarioksa
Date: 2008-03-18 14:38:36 +0100 (Tue, 18 Mar 2008)
New Revision: 264

Modified:
   pkg/R/betadiver.R
   pkg/inst/doc/diversity-vegan.Rnw
Log:
diversity-vegan updated for betadiver, and betadiver uses real quotes instead of dQuotes

Modified: pkg/R/betadiver.R
===================================================================
--- pkg/R/betadiver.R	2008-03-18 13:16:00 UTC (rev 263)
+++ pkg/R/betadiver.R	2008-03-18 13:38:36 UTC (rev 264)
@@ -20,7 +20,7 @@
                  )
     if (help) {
         for (i in 1:length(beta))
-            cat(i, dQuote(names(beta[i])),"=", beta[[i]], "\n")
+            cat(i, " \"", names(beta[i]),"\" = ", beta[[i]], "\n", sep="")
         return(invisible(NULL))
     }
     x <- ifelse(x > 0, 1, 0)
@@ -44,4 +44,3 @@
     attr(out, "call") <- match.call()
     out
 }
-

Modified: pkg/inst/doc/diversity-vegan.Rnw
===================================================================
--- pkg/inst/doc/diversity-vegan.Rnw	2008-03-18 13:16:00 UTC (rev 263)
+++ pkg/inst/doc/diversity-vegan.Rnw	2008-03-18 13:38:36 UTC (rev 264)
@@ -450,13 +450,13 @@
 The index of eq. \ref{eq:beta} is problematic because $S$ increases
 with the number of sites even when sites are all subsets of the same
 community.  Whittaker noticed this, and suggested the index to be
-found from pairwise comparison of sites.  If the numbers of species in
-two sites are $A$ and $B$, and the number of species shared between
-these two sites is $J$, then $\bar \alpha = (A+B)/2$ and $S = A+B-J$.
-Index \ref{eq:beta} can be expressed as:
+found from pairwise comparison of sites. If the number of shared
+species in two sites is $a$, and the numbers of species unique to each
+site are $b$ and $c$, then $\bar \alpha = (2a + b + c)/2$ and $S =
+a+b+c$, and index \ref{eq:beta} can be expressed as:
 \begin{equation}
   \label{eq:betabray}
-  \beta = \frac{A+B-J}{(A+B)/2} - 1 = \frac{A+B-2J}{A+B}
+  \beta = \frac{a+b+c}{(2a+b+c)/2} - 1 = \frac{b+c}{2a+b+c}
 \end{equation}
 This is the S{\o}rensen index of dissimilarity, and it can be found
 for all sites using \texttt{vegan} function \texttt{vegdist} with
@@ -467,10 +467,15 @@
 @
 
 There are many other definitions of beta diversity in addition to
-eq. \ref{eq:beta}, and many of these reduce to well known
-dissimilarity indices.  All commonly used indices can be found using
-\texttt{designdist} function which allows defining your own
-dissimilarity measures. One of the more interesting indices is based
+eq. \ref{eq:beta}.  All commonly used indices can be found using
+\texttt{betadiver}. The indices in \texttt{betadiver} can be referred
+to by subscript name, or index number:
+<<>>=
+betadiver(help=TRUE)
+@
+Some of these indices are duplicates, and many of them are well known
+dissimilarity indices.
+One of the more interesting indices is based
 on the Arrhenius species--area model
 \begin{equation}
   \label{eq:arrhenius}
@@ -483,9 +488,9 @@
 islands can be regarded as subsets of the same community, indicating
 that we really should talk about gradient differences if $z > 0.3$. We
 can find the value of $z$ for a pair of plots using function
-\texttt{designdist}:
+\texttt{betadiver}:
 <<>>=
-z <- designdist(BCI, "(log(A+B-J)-log(A+B)+log(2))/log(2)")
+z <- betadiver(BCI, "z")
 quantile(z)
 @
 The size $X$ and parameter $c$ cancel out, and the index gives the
@@ -499,8 +504,7 @@
 <<>>=
 data(dune)
 data(dune.env)
-z <- designdist(dune, "(log(A+B-J)-log(A+B)+log(2))/log(2)")
-quantile(z)
+z <- betadiver(dune, "z")
 mod <- with(dune.env, betadisper(z, Management))
 mod
 @



More information about the Vegan-commits mailing list