[Adephylo-commits] r119 - in pkg: R inst/doc man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Jan 12 15:10:54 CET 2009
Author: sdray
Date: 2009-01-12 15:10:54 +0100 (Mon, 12 Jan 2009)
New Revision: 119
Modified:
pkg/R/distances.R
pkg/R/proximities.R
pkg/R/table.phylo4d.R
pkg/R/utils.R
pkg/inst/doc/adephylo.Rnw
pkg/man/table.phylo4d.Rd
Log:
changes in phylobase must be reported: getnodes becomes getNode, becomes @edge, .data becomes @tip.data
Modified: pkg/R/distances.R
===================================================================
--- pkg/R/distances.R 2008-12-17 17:33:55 UTC (rev 118)
+++ pkg/R/distances.R 2009-01-12 14:10:54 UTC (rev 119)
@@ -11,7 +11,7 @@
method <- match.arg(method)
N <- nTips(x)
if(tips[1]=="all") { tips <- 1:N }
- tips <- getnodes(x, tips)
+ tips <- getNode(x, tips)
tips.names <- names(tips)
## some checks
@@ -110,10 +110,10 @@
method <- match.arg(method)
N <- nTips(x)
if(tips[1]=="all") { tips <- 1:N }
- tips <- getnodes(x, tips)
+ tips <- getNode(x, tips)
tips.names <- names(tips)
x <- as(x, "phylo4")
- root <- getnodes(x, N+1) # so that we have a named node
+ root <- getNode(x, N+1) # so that we have a named node
## some checks
if(is.character(checkval <- check_phylo4(x))) stop(checkval)
Modified: pkg/R/proximities.R
===================================================================
--- pkg/R/proximities.R 2008-12-17 17:33:55 UTC (rev 118)
+++ pkg/R/proximities.R 2009-01-12 14:10:54 UTC (rev 119)
@@ -13,7 +13,7 @@
normalize <- match.arg(normalize)
N <- nTips(x)
if(tips[1]=="all") { tips <- 1:N }
- tips <- getnodes(x, tips)
+ tips <- getNode(x, tips)
## some checks
if (is.character(checkval <- check_phylo4(x))) stop(checkval)
Modified: pkg/R/table.phylo4d.R
===================================================================
--- pkg/R/table.phylo4d.R 2008-12-17 17:33:55 UTC (rev 118)
+++ pkg/R/table.phylo4d.R 2009-01-12 14:10:54 UTC (rev 119)
@@ -2,7 +2,7 @@
## table.phylo4d
#############
table.phylo4d <- function(x, treetype=c("phylogram","cladogram"), symbol=c("circles", "squares"),
- repVar=1:ncol(x$tip.data), center=TRUE, scale=TRUE, legend=TRUE, grid=TRUE, box=TRUE,
+ repVar=1:ncol(x at tip.data), center=TRUE, scale=TRUE, legend=TRUE, grid=TRUE, box=TRUE,
show.tip.label=TRUE, show.node.label=TRUE, show.var.label=TRUE,
ratio.tree=1/3, font=3,
tip.label=x at tip.label, var.label=colnames(x at tip.data),
@@ -28,7 +28,7 @@
## convert the tree into phylo
tre <- suppressWarnings(as(x,"phylo"))
- tre$node.label <- x at node.label # this should be done by the as(x,"phylo")
+ ##tre$node.label <- x at node.label # this should be done by the as(x,"phylo")
## plot only tree if no tip data
if(ncol(tdata(x,which="tip")) == 0) {
plot.phylo(tre, type=treetype, direction="rightwards", show.tip.label=show.tip.label,
Modified: pkg/R/utils.R
===================================================================
--- pkg/R/utils.R 2008-12-17 17:33:55 UTC (rev 118)
+++ pkg/R/utils.R 2009-01-12 14:10:54 UTC (rev 119)
@@ -19,7 +19,7 @@
## but will often be computed outside, once and for all.
##
.tipToRoot <- function(x, tip, root, include.root=FALSE){
- E <- x$edge
+ E <- x at edge
path <- NULL
curNode <- tip
while(curNode != root){
@@ -31,7 +31,7 @@
path <- path[-length(path)] # exclude the root
}
- return(getnodes(x, path))
+ return(getNode(x, path))
} # end tipToRoot
@@ -49,8 +49,8 @@
## some checks
if (is.character(checkval <- check_phylo4(x))) stop(checkval)
- t1 <- getnodes(x, tip1)
- t2 <- getnodes(x, tip2)
+ t1 <- getNode(x, tip1)
+ t2 <- getNode(x, tip2)
if(any(is.na(c(t1,t2)))) stop("wrong tip specified")
if(any(c(t1,t2) > nTips(x))) stop("specified nodes are internal nodes")
if(length(t1) != length(t2)) { # recycle tip1 and tip2
@@ -69,7 +69,7 @@
## some global variables
N <- nTips(x)
- root <- getnodes(x, N+1)
+ root <- getNode(x, N+1)
E <- x at edge
allTips <- unique(c(t1,t2))
@@ -83,7 +83,7 @@
## path <- c(path, curNode)
## } # end while
- ## path <- getnodes(x, path)
+ ## path <- getNode(x, path)
## return(path)
## } # end tipToRoot
@@ -124,7 +124,7 @@
res <- lapply(1:length(allPath1), function(i) pathTwoTips.no.mrca(allPath1[[i]], allPath2[[i]]) )
temp.names <- names(res)
temp <- sapply(res, function(vec) length(vec)>0)
- res[temp] <- lapply(res[temp], function(vec) getnodes(x, vec) ) # name the nodes
+ res[temp] <- lapply(res[temp], function(vec) getNode(x, vec) ) # name the nodes
names(res) <- temp.names
}
Modified: pkg/inst/doc/adephylo.Rnw
===================================================================
--- pkg/inst/doc/adephylo.Rnw 2008-12-17 17:33:55 UTC (rev 118)
+++ pkg/inst/doc/adephylo.Rnw 2009-01-12 14:10:54 UTC (rev 119)
@@ -328,7 +328,7 @@
<<moranI>>=
W <- proxTips(myTree, met="Abouheif")
moran.idx(tdata(ung)$afbw, W)
-moran.idx(ung$tip.data[,1], W, addInfo=TRUE)
+moran.idx(ung at tip.data[,1], W, addInfo=TRUE)
@
From here, it is quite straightforward to build a non-parametric test
Modified: pkg/man/table.phylo4d.Rd
===================================================================
--- pkg/man/table.phylo4d.Rd 2008-12-17 17:33:55 UTC (rev 118)
+++ pkg/man/table.phylo4d.Rd 2009-01-12 14:10:54 UTC (rev 119)
@@ -15,7 +15,7 @@
}
\usage{
table.phylo4d(x, treetype=c("phylogram","cladogram"), symbol=c("circles", "squares"),
- repVar=1:ncol(x$tip.data), center=TRUE, scale=TRUE, legend=TRUE, grid=TRUE, box=TRUE,
+ repVar=1:ncol(x at tip.data), center=TRUE, scale=TRUE, legend=TRUE, grid=TRUE, box=TRUE,
show.tip.label=TRUE, show.node.label=TRUE, show.var.label=TRUE,
ratio.tree=1/3, font=3,
tip.label=x at tip.label, var.label=colnames(x at tip.data),
@@ -109,4 +109,4 @@
}
}
\keyword{hplot}
-\keyword{multivariate}
\ No newline at end of file
+\keyword{multivariate}
More information about the Adephylo-commits
mailing list