[Archetypes-commits] r31 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 12 11:19:34 CET 2010


Author: manuel
Date: 2010-03-12 11:19:34 +0100 (Fri, 12 Mar 2010)
New Revision: 31

Modified:
   pkg/R/pcplot.R
Log:
bug fix.

Modified: pkg/R/pcplot.R
===================================================================
--- pkg/R/pcplot.R	2010-03-11 16:48:14 UTC (rev 30)
+++ pkg/R/pcplot.R	2010-03-12 10:19:34 UTC (rev 31)
@@ -48,15 +48,15 @@
   colnames(sx) <- colnames(x)
 
   x <- sx
-  
-  matplot(1:ncol(x), t(x), type="l", col=col, lty=lty, 
+
+  matplot(1:ncol(x), t(x), type="l", col=col, lty=lty,
           xlab="", ylab="", axes=FALSE, ...)
   axis(1, at=1:ncol(x), labels=colnames(x), ...)
-   
+
   for (i in 1:ncol(x)) {
     lines(c(i, i), c(0, 1), col="grey70")
-    if (var.label) 
-      text(c(i, i), c(0, 1), labels=format(rx[, i], digits=3), 
+    if (var.label)
+      text(c(i, i), c(0, 1), labels=format(rx[, i], digits=3),
            xpd=NA, offset=0.3, pos=c(1, 3), cex=0.7)
   }
 }
@@ -77,6 +77,8 @@
               function(i) {
                 (x[,i] - rx[1,i]) / (rx[2,i] - rx[1,i])
               })
-  
+  if ( is.vector(x) )
+    x <- matrix(x, nrow = 1)
+
   matlines(1:ncol(x), t(x), col=col, lty=lty, ...)
 }



More information about the Archetypes-commits mailing list