[Adephylo-commits] r97 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 13 18:13:22 CET 2008


Author: jombart
Date: 2008-12-13 18:13:22 +0100 (Sat, 13 Dec 2008)
New Revision: 97

Modified:
   pkg/R/ppca.R
Log:
plot.ppca working well.


Modified: pkg/R/ppca.R
===================================================================
--- pkg/R/ppca.R	2008-12-13 17:03:08 UTC (rev 96)
+++ pkg/R/ppca.R	2008-12-13 17:13:22 UTC (rev 97)
@@ -364,7 +364,7 @@
 ############
 # plot.ppca
 ############
-plot.ppca <- function(x, axes = 1, useLag=FALSE, ...){
+plot.ppca <- function(x, axes = 1:ncol(x$li), useLag=FALSE, ...){
 
     ## some checks
     if (!inherits(x, "ppca")) stop("Use only with 'ppca' objects.")
@@ -386,7 +386,7 @@
     r <- length(x$eig)
     col <- rep("white", r)
 
-    keptAxes <- c( (1:r)[x$nfposi], (r:1)[x$nfnega]) # kept axes
+    keptAxes <- c( (1:r)[1:x$nfposi], (r:1)[1:x$nfnega]) # kept axes
     col[keptAxes] <- "grey"
 
     repAxes <- gsub("PC","",colnames(x$li)[axes]) # represented axes
@@ -425,7 +425,7 @@
     cexLabel <- 1
     cexSymbol <- 1
 
-    temp <- try(scatter(x, ratio.tree=ratioTree,
+    temp <- try(scatter(x, axis=axes, ratio.tree=ratioTree,
                         cex.lab=cexLabel, cex.sym=cexSymbol,
                         show.node=FALSE, useLag=useLag), silent=TRUE) # try default plot
     scatterOk <- !inherits(temp,"try-error")
@@ -444,7 +444,7 @@
         }
         cexSymbol <- cexSymbol - .05
 
-        temp <- try(scatter(x, ratio.tree=ratioTree,
+        temp <- try(scatter(x, axis=axes, ratio.tree=ratioTree,
                         cex.lab=cexLabel, cex.sym=cexSymbol,
                         show.node=FALSE, useLag=useLag), silent=TRUE) # try default plot
         scatterOk <- !inherits(temp,"try-error")



More information about the Adephylo-commits mailing list