[Phylobase-commits] r159 - in pkg: . tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 8 08:21:17 CET 2008


Author: pdc
Date: 2008-03-08 08:21:17 +0100 (Sat, 08 Mar 2008)
New Revision: 159

Modified:
   pkg/DESCRIPTION
   pkg/tests/plottest.R
Log:
The MASS library appears to only be used in one plot test. 

Added a check for the library and moved to the suggest line to prevent automatic loading

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2008-03-08 01:49:41 UTC (rev 158)
+++ pkg/DESCRIPTION	2008-03-08 07:21:17 UTC (rev 159)
@@ -3,8 +3,8 @@
 Title: Base package for phylogenetic structures and comparative data
 Version: 0.3
 Date: 2007-12-18
-Depends: methods, ape(>= 2.1), MASS
-Suggests: ade4
+Depends: methods, ape(>= 2.1)
+Suggests: ade4, MASS
 Author: R Hackathon (Ben Bolker, Marguerite Butler, Peter Cowan,  Damien de Vienne, Thibaut Jombart, Steve Kembel, David Orme, Emmanuel Paradis, Derrick Zwickl)
 Maintainer:  Ben Bolker <bolker at ufl.edu>
 Description: Provides a base S4 class for comparative methods, incorporating one or more trees and trait data

Modified: pkg/tests/plottest.R
===================================================================
--- pkg/tests/plottest.R	2008-03-08 01:49:41 UTC (rev 158)
+++ pkg/tests/plottest.R	2008-03-08 07:21:17 UTC (rev 159)
@@ -32,16 +32,16 @@
 
 ## Playing with new ways of plotting
 
-library(MASS)
-dist1 <- cophenetic.phylo(as(g2,"phylo"))
-mdspos <- isoMDS(dist1)$points
-par(mfrow=c(2,2))
-plot(g1)
-plot(mdspos,type="n")
-text(mdspos[,1],mdspos[,2],abbreviate(rownames(mdspos)))
-cmdpos <- cmdscale(dist1)
-plot(cmdpos,type="n")
-text(cmdpos[,1],cmdpos[,2],abbreviate(rownames(mdspos)))
-
+if(require(MASS)){
+    dist1 <- cophenetic.phylo(as(g2,"phylo"))
+    mdspos <- isoMDS(dist1)$points
+    par(mfrow=c(2,2))
+    plot(g1)
+    plot(mdspos,type="n")
+    text(mdspos[,1],mdspos[,2],abbreviate(rownames(mdspos)))
+    cmdpos <- cmdscale(dist1)
+    plot(cmdpos,type="n")
+    text(cmdpos[,1],cmdpos[,2],abbreviate(rownames(mdspos)))
+}
 ## never mind, I don't know how to construct a useful
 ##  2D color space anyway ...



More information about the Phylobase-commits mailing list