[Phylobase-commits] r361 - in pkg: R man tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Dec 20 02:01:10 CET 2008
Author: pdc
Date: 2008-12-20 02:01:10 +0100 (Sat, 20 Dec 2008)
New Revision: 361
Modified:
pkg/R/identify.R
pkg/man/geospiza.Rd
pkg/man/phylo4-class.Rd
pkg/man/printphylo4.Rd
pkg/man/prune-methods.Rd
pkg/man/subset-methods.Rd
pkg/tests/plottest.R
Log:
several changes to tests and examples to fix/remove calls to legacy plot commands
also temporarily disabled the identify method
Modified: pkg/R/identify.R
===================================================================
--- pkg/R/identify.R 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/R/identify.R 2008-12-20 01:01:10 UTC (rev 361)
@@ -1,20 +1,20 @@
-setGeneric("identify")
-
-setMethod("identify","phylo4",
- function(x,n=1,...) {
- plot(x, ...)
- last <- .last_plot.phylo # information return from plot.phylo
- N.tip <- nTips(x)
- N.node <- nNodes(x)
- tips <- labels(x)
- if (!hasNodeLabels(x)) {
- nodes <- (N.tip+1):(N.tip+N.node)
- } else nodes <- nodeLabels(x)
- labs<-c(rep("",N.tip), nodes)
- click <- identify(last$xx, last$yy, labels=labs, n=n)
- ## if (click > N.tip) {
- ## stop("this is a tip, you have to choose a node\n")
- ##}
- names(click) <- labs[click]
- return(click)
- })
+## setGeneric("identify")
+##
+## setMethod("identify","phylo4",
+## function(x,n=1,...) {
+## plot(x, ...)
+## last <- .last_plot.phylo # information return from plot.phylo
+## N.tip <- nTips(x)
+## N.node <- nNodes(x)
+## tips <- labels(x)
+## if (!hasNodeLabels(x)) {
+## nodes <- (N.tip+1):(N.tip+N.node)
+## } else nodes <- nodeLabels(x)
+## labs<-c(rep("",N.tip), nodes)
+## click <- identify(last$xx, last$yy, labels=labs, n=n)
+## ## if (click > N.tip) {
+## ## stop("this is a tip, you have to choose a node\n")
+## ##}
+## names(click) <- labs[click]
+## return(click)
+## })
Modified: pkg/man/geospiza.Rd
===================================================================
--- pkg/man/geospiza.Rd 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/man/geospiza.Rd 2008-12-20 01:01:10 UTC (rev 361)
@@ -26,6 +26,6 @@
}
\examples{
data(geospiza)
-plot(geospiza, adj = 0.4, cex.lab = 0.7, cex.sym = 0.8)
+plot(geospiza)
}
\keyword{datasets}
Modified: pkg/man/phylo4-class.Rd
===================================================================
--- pkg/man/phylo4-class.Rd 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/man/phylo4-class.Rd 2008-12-20 01:01:10 UTC (rev 361)
@@ -82,9 +82,21 @@
sumryP1
## summary of a polytomous tree
- E <- matrix(c(8,9,10,10,9,9,8,11,11,11,9,10,1,2,3,4,11,5,6,7),ncol=2)
+ E <- matrix(c(
+ 8, 9,
+ 9, 10,
+ 10, 1,
+ 10, 2,
+ 9, 3,
+ 9, 4,
+ 8, 11,
+ 11, 5,
+ 11, 6,
+ 11, 7,
+ NA, 8), ncol=2, byrow=TRUE)
+
P2 <- phylo4(E)
- plot(P2,show.node=TRUE)
+ plot(P2, show.node.label=TRUE)
sumryP2 <- summary(P2)
sumryP2
}
Modified: pkg/man/printphylo4.Rd
===================================================================
--- pkg/man/printphylo4.Rd 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/man/printphylo4.Rd 2008-12-20 01:01:10 UTC (rev 361)
@@ -41,7 +41,7 @@
##plot(tree,show.node=TRUE) ## plotting broken with empty node labels: FIXME
tip.data <- data.frame(size=c(1,2,3), row.names=c("a", "b", "c"))
treedata <- phylo4d(tree, tip.data)
-plot(treedata,ratio=.7,cent=FALSE,scale=FALSE)
+plot(treedata)
print(treedata)
}
Modified: pkg/man/prune-methods.Rd
===================================================================
--- pkg/man/prune-methods.Rd 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/man/prune-methods.Rd 2008-12-20 01:01:10 UTC (rev 361)
@@ -89,8 +89,8 @@
plot(as(prune(bird.families, tip),"phylo"))
plot(as(prune(bird.families, tip, trim.internal = FALSE),"phylo"))
data(bird.orders)
-plot(as(prune(bird.orders, 6:23, subtree = TRUE),"phylo"), font = 1)
-plot(as(prune(bird.orders, c(1:5, 20:23), subtree = TRUE), "phylo"), font = 1)
+plot(as(prune(bird.orders, 6:23, subtree = TRUE),"phylo"))
+plot(as(prune(bird.orders, c(1:5, 20:23), subtree = TRUE), "phylo"))
### Examples of the use of `root.edge'
tr <- as(ape::read.tree(text = "(A:1,(B:1,(C:1,(D:1,E:1):1):1):1):1;"),"phylo4")
Modified: pkg/man/subset-methods.Rd
===================================================================
--- pkg/man/subset-methods.Rd 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/man/subset-methods.Rd 2008-12-20 01:01:10 UTC (rev 361)
@@ -77,12 +77,11 @@
plot(subset(g1,node.subtree=18))
## "[" examples
-par(mfrow=c(1,2),mar=rep(.1,4))
-plot(g1,show.node=TRUE)
-plot(g1[c(1:6,14)],show.node=TRUE)
+plot(g1,show.node.label=TRUE)
+plot(g1[c(1:6,14)],show.node.label=TRUE)
-plot(geospiza[c(1:6,14)],show.node=TRUE,cex.sym=.5,cex.label=.7)
-plot(geospiza[c(1:6,14),3:5],show.node=TRUE,cex.sym=.5,cex.label=.7)
+plot(geospiza[c(1:6,14)],show.node.label=TRUE)
+plot(geospiza[c(1:6,14),3:5],show.node.label=TRUE)
}
\keyword{manip}
\keyword{methods}
Modified: pkg/tests/plottest.R
===================================================================
--- pkg/tests/plottest.R 2008-12-20 00:58:16 UTC (rev 360)
+++ pkg/tests/plottest.R 2008-12-20 01:01:10 UTC (rev 361)
@@ -27,7 +27,7 @@
g3 = subset(g2,tips.exclude=c("fuliginosa","fortis","magnirostris",
"conirostris","scandens"))
plot(extract.tree(g3)) ## phylo4
-plot(g3,ratio=.3,cex.sym=.6,cex.lab=.6)
+plot(g3)
## Playing with new ways of plotting
@@ -37,11 +37,11 @@
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)))
+ ## 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