[Vegan-commits] r2171 - branches/2.0/R branches/2.0/inst branches/2.0/man www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 21 12:18:45 CEST 2012


Author: jarioksa
Date: 2012-05-21 12:18:44 +0200 (Mon, 21 May 2012)
New Revision: 2171

Modified:
   branches/2.0/R/bioenv.default.R
   branches/2.0/inst/ChangeLog
   branches/2.0/inst/NEWS.Rd
   branches/2.0/man/bioenv.Rd
   www/NEWS.html
Log:
merge r2170: bioenv accepts dissimilarities as input

Modified: branches/2.0/R/bioenv.default.R
===================================================================
--- branches/2.0/R/bioenv.default.R	2012-05-20 13:55:49 UTC (rev 2170)
+++ branches/2.0/R/bioenv.default.R	2012-05-21 10:18:44 UTC (rev 2171)
@@ -33,7 +33,18 @@
     }
     x <- scale(env)
     best <- list()
-    comdis <- vegdist(comm, method = index)
+    if (inherits(comm, "dist")) {
+        comdis <- comm
+        index <- attr(comdis, "method")
+        if (is.null(index))
+            index <- "unspecified"
+    } else if (is.matrix(comm) && nrow(comm) == ncol(comm) &&
+             isTRUE(all.equal(comm, t(comm)))) {
+        comdis <- as.dist(comm)
+        index <- "supplied square matrix"
+    } else {
+        comdis <- vegdist(comm, method = index)
+    }
     for (i in 1:upto) {
         if (trace) {
             nvar <- choose(n, i)

Modified: branches/2.0/inst/ChangeLog
===================================================================
--- branches/2.0/inst/ChangeLog	2012-05-20 13:55:49 UTC (rev 2170)
+++ branches/2.0/inst/ChangeLog	2012-05-21 10:18:44 UTC (rev 2171)
@@ -4,6 +4,7 @@
 
 Version 2.0-4 (opened March 9, 2012)
 
+	* merge r2170: bioenv accepts dissimilarities as input.
 	* merge r2167: warn about unequal aspect ratio in ordiplot3d.
 	* merge r2162: set equal axis scales for ordiplot3d.
 	* merge r2156: betadisper example adapted for default spatial

Modified: branches/2.0/inst/NEWS.Rd
===================================================================
--- branches/2.0/inst/NEWS.Rd	2012-05-20 13:55:49 UTC (rev 2170)
+++ branches/2.0/inst/NEWS.Rd	2012-05-21 10:18:44 UTC (rev 2171)
@@ -24,10 +24,10 @@
 
       \item \code{envfit} failed with unused factor levels.
 
-      \item Equal aspect ratio cannot be forced to \code{ordiplot3d}
-        because underlying core routines do not allow this. Now
-        \code{ordiplot3d} sets equal axis ranges, and the documents
-        urge users to verify that the results the aspect ratio is
+      \item Equal aspect ratio cannot be set exactly in
+        \code{ordiplot3d} because underlying core routines do not allow
+        this. Now \code{ordiplot3d} sets equal axis ranges, and the
+        documents urge users to verify that the aspect ratio is
         reasonably equal and the graph looks like a cube.
     
     }
@@ -44,6 +44,11 @@
         describing the hierarcy is missing, the method gives an
         overall partitioning to alpha, beta and gamma diversities.
 
+      \item \code{bioenv} accepts dissimilarities or square matrices
+        that can be interpreted as dissimilarities as an alternative to
+        community data.  This allows using other dissimilarities than
+        those available in \code{vegdist}.
+ 
       \item \code{msoplot} is more configurable, and allows, for
         instance, setting y-axis limits.
 

Modified: branches/2.0/man/bioenv.Rd
===================================================================
--- branches/2.0/man/bioenv.Rd	2012-05-20 13:55:49 UTC (rev 2170)
+++ branches/2.0/man/bioenv.Rd	2012-05-21 10:18:44 UTC (rev 2171)
@@ -18,11 +18,12 @@
 }
 
 \arguments{
-  \item{comm}{Community data frame. }
+  \item{comm}{Community data frame or a dissimilarity object or a square
+    matrix that can be interpreted as dissimilarities. }
   \item{env}{Data frame of continuous environmental variables. }
   \item{method}{The correlation method used in \code{\link{cor}}.}
-  \item{index}{The dissimilarity index used for community data in
-    \code{\link{vegdist}}. }
+  \item{index}{The dissimilarity index used for community data (\code{comm}) 
+    in \code{\link{vegdist}}. This is ignored if \code{comm} are dissimilarities.}
   \item{upto}{Maximum number of parameters in studied subsets.}
   \item{formula, data}{Model \code{\link{formula}} and data.}
   \item{trace}{Trace the advance of calculations }

Modified: www/NEWS.html
===================================================================
--- www/NEWS.html	2012-05-20 13:55:49 UTC (rev 2170)
+++ www/NEWS.html	2012-05-21 10:18:44 UTC (rev 2171)
@@ -39,13 +39,13 @@
 <li> <p><code>envfit</code> failed with unused factor levels.
 </p>
 </li>
-<li><p> Equal aspect ratio cannot be forced to <code>ordiplot3d</code>
-because underlying core routines do not allow this. Now
-<code>ordiplot3d</code> sets equal axis ranges, and the documents
-urge users to verify that the results the aspect ratio is
+<li><p> Equal aspect ratio cannot be set exactly in
+<code>ordiplot3d</code> because underlying core routines do not allow
+this. Now <code>ordiplot3d</code> sets equal axis ranges, and the
+documents urge users to verify that the aspect ratio is
 reasonably equal and the graph looks like a cube.
 </p>
-</li></ul>
+</ul>
 
 
 
@@ -64,10 +64,16 @@
 overall partitioning to alpha, beta and gamma diversities.
 </p>
 </li>
+<li> <p><code>bioenv</code> accepts dissimilarities or square matrices
+that can be interpreted as dissimilarities as an alternative to
+community data.  This allows using other dissimilarities than
+those available in <code>vegdist</code>.
+</p>
+</li>
 <li> <p><code>msoplot</code> is more configurable, and allows, for
 instance, setting y-axis limits.
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -104,7 +110,7 @@
 <a href="https://github.com/jarioksa/vegan">GitHub</a>
 by Eduard Szöcs (Uni Landau, Germany).
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -136,7 +142,7 @@
 was reported as an error in <code>ordiplot</code> in
 <a href="https://stat.ethz.ch/pipermail/r-sig-ecology/2012-February/002768.html">R-sig-ecology</a> mailing list.
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -177,7 +183,7 @@
 intensity. Thanks to consultation to Yong Cao (Univ Illinois,
 USA).
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -219,7 +225,7 @@
 speed-up in the internal f.test() function is fully
 realised. Reported by Nicholas Lewin-Koh.
 </p>
-</li></ul>
+</ul>
 
   
 
@@ -239,7 +245,7 @@
 are class centroids of each point, but for constrained ordination
 with no <code>groups</code> they are the LC scores.
 </p>
-</li></ul>
+</ul>
 		 
   
 
@@ -280,7 +286,7 @@
 [<a href="http://www.esajournals.org/doi/abs/10.1890/ES10-00117.1">doi:10.1890/ES10-00117.1</a>],
 and was developed with the consultation of Brian Inouye.
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -319,7 +325,7 @@
 results but you probably wish to upgrade <span class="pkg">vegan</span> to avoid
 annoying warnings.
 </p>
-</li></ul>
+</ul>
 	
  
 
@@ -334,7 +340,7 @@
 showed that in most cases an improved ordering was found rather
 early in tries, and the results are equally good in most cases.
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -370,7 +376,7 @@
 <span class="pkg">permute</span>, but currently only <code>betadisper</code> uses the new
 feature. 
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -426,7 +432,7 @@
 were implemented because they were found good for species-area
 models by Dengler (<EM>J. Biogeogr.</EM> 36, 728-744; 2009).
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -468,7 +474,7 @@
 the length of the <code>pool</code> matches the number of
 observations.
 </p>
-</li></ul>
+</ul>
 
  
 
@@ -487,7 +493,7 @@
 was not intended for normal use, but packages depending on that
 code in <span class="pkg">vegan</span> should instead depend on <span class="pkg">permute</span>.
 </p>
-</li></ul>
+</ul>
   
  
 
@@ -500,7 +506,7 @@
 <li> <p><code>treeheight</code> uses much snappier code. The results
 should be unchanged.
 </p>
-</li></ul>
+</ul>
 
  
 



More information about the Vegan-commits mailing list