[Phylobase-commits] r312 - branches/pdcgsoc/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 19 01:51:34 CET 2008


Author: pdc
Date: 2008-12-19 01:51:34 +0100 (Fri, 19 Dec 2008)
New Revision: 312

Modified:
   branches/pdcgsoc/R/treePlot.R
Log:
comment out code not ready for prime time

Modified: branches/pdcgsoc/R/treePlot.R
===================================================================
--- branches/pdcgsoc/R/treePlot.R	2008-12-18 23:21:00 UTC (rev 311)
+++ branches/pdcgsoc/R/treePlot.R	2008-12-19 00:51:34 UTC (rev 312)
@@ -18,6 +18,7 @@
 {
     ## TODO three dimensional histogram as example, compute values on full dataset
     ## then generate phylo4d object with summary data and plot
+    if (!all(is(phy, 'phylo4'), is(phy, 'phylo4d'))) stop('treePlot requires a phylo4 or phylo4d object')
     if (!isRooted(phy)) stop("treePlot function requires a rooted tree.")
     width  <- height <- (1 - margin)  ## TODO: do these have to be hard-coded?
     type   <- match.arg(type)
@@ -530,23 +531,23 @@
 setGeneric("treePlot", useAsDefault = treePlot)
 setMethod("treePlot", signature = c('phylo4', 'phylo4d'), treePlot)
 
-gridbasefun <- function(f, naked = TRUE, scale = TRUE) {
-    function(x, tmin, tmax, ...) {
-        require(gridBase)
-        op <- par()
-        if (naked) {
-            par(ann = FALSE, mar = rep(0, 4))
-            ## this could take a bit of hacking
-            ## to work nicely in general -- too bad
-            ## par(ann=FALSE) doesn't work in general
-            ## Could set main="", xlab="", ylab="", axes=FALSE
-            ## but this will break 
-        }
-        ## this must be the *last* par() call
-        suppressWarnings(par(plt = gridPLT(), new = TRUE)) 
-        if(!all(is.na(x))) {
-            f(x, xlim = c(tmin, tmax), ...)
-        }
-    }
-}
-
+# gridbasefun <- function(f, naked = TRUE, scale = TRUE) {
+#     function(x, tmin, tmax, ...) {
+#         require(gridBase)
+#         op <- par()
+#         if (naked) {
+#             par(ann = FALSE, mar = rep(0, 4))
+#             ## this could take a bit of hacking
+#             ## to work nicely in general -- too bad
+#             ## par(ann=FALSE) doesn't work in general
+#             ## Could set main="", xlab="", ylab="", axes=FALSE
+#             ## but this will break 
+#         }
+#         ## this must be the *last* par() call
+#         suppressWarnings(par(plt = gridPLT(), new = TRUE)) 
+#         if(!all(is.na(x))) {
+#             f(x, xlim = c(tmin, tmax), ...)
+#         }
+#     }
+# }
+# 



More information about the Phylobase-commits mailing list