[Adephylo-commits] r39 - in pkg: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Nov 26 15:58:27 CET 2008
Author: jombart
Date: 2008-11-26 15:58:26 +0100 (Wed, 26 Nov 2008)
New Revision: 39
Modified:
pkg/R/distances.R
pkg/man/distRoot.Rd
pkg/man/distTips.Rd
pkg/man/sp.tips.Rd
Log:
Some doc fixes.
findAllPairs fixed in distTips.
Modified: pkg/R/distances.R
===================================================================
--- pkg/R/distances.R 2008-11-26 14:10:34 UTC (rev 38)
+++ pkg/R/distances.R 2008-11-26 14:58:26 UTC (rev 39)
@@ -23,7 +23,7 @@
res <- list(i=NULL,j=NULL)
k <- 0
for(i in 1:(length(vec)-1)){
- for(j in 2:length(vec)){
+ for(j in (i+1):length(vec)){
k <- k+1
res[[1]][k] <- i
res[[2]][k] <- j
@@ -39,7 +39,8 @@
if(method != "brlength") {
allPath <- sp.tips(x, allPairs$i, allPairs$j, useTipNames=TRUE, quiet=TRUE)
} else {
- allPath <- sp.tips(x, allPairs$i, allPairs$j, useTipNames=TRUE, quiet=TRUE, include.mrca=FALSE)
+ allPath <- sp.tips(x, allPairs$i, allPairs$j, useTipNames=TRUE, quiet=TRUE,
+ include.mrca=FALSE)
}
## compute distances
@@ -47,7 +48,8 @@
if(!hasEdgeLength(x)) stop("x does not have branch length")
## add tip1 and tip2 to the paths, so that these edges are counted
allPath.names <- names(allPath)
- allPath <- lapply(1:length(allPath), function(i) c(allPath[[i]], allPairs[i,]) )
+ allPath <- lapply(1:length(allPath), function(i)
+ c(allPath[[i]], allPairs[i,1], allPairs[i,2]) )
names(allPath) <- allPath.names
edge.idx <- lapply(allPath, function(e) getedges(x, e) ) # list of indices of edges
Modified: pkg/man/distRoot.Rd
===================================================================
--- pkg/man/distRoot.Rd 2008-11-26 14:10:34 UTC (rev 38)
+++ pkg/man/distRoot.Rd 2008-11-26 14:58:26 UTC (rev 39)
@@ -11,6 +11,8 @@
\arguments{
\item{x}{a tree of class \code{\link[pkg:ape]{phylo}},
\linkS4class{phylo4} or \linkS4class{phylo4d}.}
+ \item{tips}{A vector of integers identifying tips by their numbers, or
+ a vector of characters identifying tips by their names.}
\item{method}{a character string (full or abbreviated without
ambiguity) specifying the method used to compute distances ;
possible values are:\cr
Modified: pkg/man/distTips.Rd
===================================================================
--- pkg/man/distTips.Rd 2008-11-26 14:10:34 UTC (rev 38)
+++ pkg/man/distTips.Rd 2008-11-26 14:58:26 UTC (rev 39)
@@ -3,8 +3,10 @@
\title{Compute some phylogenetic distance between two nodes}
\description{
The function \code{distTips} computes a given distance between a set
- of tips of a phylogeny. This distance is computed from the shortest path
- between the nodes. Several distances can be used, defaulting to the
+ of tips of a phylogeny. A vector of tips is supplied: distances
+ between all possible pairs of these tips are computed.
+ The distances are computed from the shortest path
+ between the tips. Several distances can be used, defaulting to the
sum of branch lengths (see argument \code{method}).
}
\usage{
@@ -13,6 +15,9 @@
\arguments{
\item{x}{a tree of class \code{\link[pkg:ape]{phylo}},
\linkS4class{phylo4} or \linkS4class{phylo4d}.}
+ \item{tips}{A vector of integers identifying tips by their numbers, or
+ a vector of characters identifying tips by their names. Distances
+ will be computed between all possible pairs of tips.}
\item{method}{a character string (full or abbreviated without
ambiguity) specifying the method used to compute distances ;
possible values are:\cr
Modified: pkg/man/sp.tips.Rd
===================================================================
--- pkg/man/sp.tips.Rd 2008-11-26 14:10:34 UTC (rev 38)
+++ pkg/man/sp.tips.Rd 2008-11-26 14:58:26 UTC (rev 39)
@@ -8,7 +8,7 @@
\linkS4class{phylo4d}. Several tips can be provided at a time.
}
\usage{
-sp.tips(x, tip1, tip2, useTipNames=FALSE, quiet=FALSE)
+sp.tips(x, tip1, tip2, useTipNames=FALSE, quiet=FALSE, include.mrca=TRUE)
}
\arguments{
\item{x}{A tree of class \code{\link[pkg:ape]{phylo}},
More information about the Adephylo-commits
mailing list