[Picante-commits] r176 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 14 01:34:14 CET 2009


Author: pdc
Date: 2009-02-14 01:34:14 +0100 (Sat, 14 Feb 2009)
New Revision: 176

Modified:
   pkg/R/color.plot.phylo.R
Log:
color selection should be based on the length not the type of the breaks
prevents this error:
Error in cut.default(ordered.trait, breaks = num.breaks, labels = col.names) : 
  labels/breaks length conflict


Modified: pkg/R/color.plot.phylo.R
===================================================================
--- pkg/R/color.plot.phylo.R	2009-01-28 00:54:40 UTC (rev 175)
+++ pkg/R/color.plot.phylo.R	2009-02-14 00:34:14 UTC (rev 176)
@@ -16,7 +16,7 @@
                     phylo, df, trait, taxa.names,
                     num.breaks = ifelse(is.factor(df[,trait]),
                         length(levels(df[,trait])), 12),
-                    col.names = rainbow(ifelse(is.vector(num.breaks), length(num.breaks) - 1, num.breaks)),
+                    col.names = rainbow(ifelse(length(num.breaks) > 1, length(num.breaks) - 1, num.breaks)),
                     cut.labs = NULL,
                     leg.title = NULL,
                     main = trait,
@@ -61,7 +61,7 @@
     }
     plot.phylo(
         phylo,
-        y.lim = c(0,80),
+        ## y.lim = c(0,80),
         cex = .8,
         tip.color = tip.color,
         main = main,



More information about the Picante-commits mailing list