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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 2 08:12:52 CEST 2011


Author: jarioksa
Date: 2011-08-02 08:12:50 +0200 (Tue, 02 Aug 2011)
New Revision: 1689

Modified:
   pkg/vegan/R/orditorp.R
Log:
orditorp handles NA scores

Modified: pkg/vegan/R/orditorp.R
===================================================================
--- pkg/vegan/R/orditorp.R	2011-07-24 06:46:16 UTC (rev 1688)
+++ pkg/vegan/R/orditorp.R	2011-08-02 06:12:50 UTC (rev 1689)
@@ -8,10 +8,15 @@
     if (missing(pcol))
         pcol <- col
     x <- scores(x, display = display, choices = choices, ...)
+    kk <- complete.cases(x)
     if (missing(labels))
         labels <- rownames(x)
     if (missing(priority))
         priority <- rowSums((scale(x)^2))
+    ## remove NA scores
+    x <- x[kk,]
+    priority <- priority[kk]
+    labels <- labels[kk]
     w <- abs(strwidth(labels, cex = cex))/2 * air
     h <- abs(strheight(labels, cex = cex))/2 * air
     xx <- cbind(x[, 1] - w, x[, 1] + w, x[, 2] - h, x[, 2] +



More information about the Vegan-commits mailing list