[Vegan-commits] r1237 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 19 08:31:54 CEST 2010


Author: jarioksa
Date: 2010-07-19 08:31:53 +0200 (Mon, 19 Jul 2010)
New Revision: 1237

Modified:
   pkg/vegan/R/ordiellipse.R
Log:
ordiellipse uses veganCovEllipse

Modified: pkg/vegan/R/ordiellipse.R
===================================================================
--- pkg/vegan/R/ordiellipse.R	2010-07-19 06:31:25 UTC (rev 1236)
+++ pkg/vegan/R/ordiellipse.R	2010-07-19 06:31:53 UTC (rev 1237)
@@ -4,9 +4,6 @@
               w = weights(ord, display),
               show.groups, label = FALSE,  ...)
 {
-    ## Define Circle for an ellipse: taken from the 'car' package
-    theta <- (0:51) * 2 * pi/51
-    Circle <- cbind(cos(theta), sin(theta))
     weights.default <- function(object, ...) NULL
     kind <- match.arg(kind)
     draw <- match.arg(draw)
@@ -42,7 +39,7 @@
             if (missing(conf))
                 t <- 1
             else t <- sqrt(qchisq(conf, 2))
-            xy <- t(mat$center + t * t(Circle %*% chol(mat$cov)))
+            xy <- veganCovEllipse(mat$cov, mat$center, t)
             if (draw == "lines")
                 ordiArgAbsorber(xy, FUN = lines, ...)
             else if (draw == "polygon") 



More information about the Vegan-commits mailing list