[Adephylo-commits] r88 - in pkg: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Dec 12 19:24:42 CET 2008
Author: jombart
Date: 2008-12-12 19:24:42 +0100 (Fri, 12 Dec 2008)
New Revision: 88
Modified:
pkg/R/partition.R
pkg/man/treePart.Rd
Log:
treePart doc; now treePart outputs data.frames.
Modified: pkg/R/partition.R
===================================================================
--- pkg/R/partition.R 2008-12-12 18:13:58 UTC (rev 87)
+++ pkg/R/partition.R 2008-12-12 18:24:42 UTC (rev 88)
@@ -67,7 +67,7 @@
res <- res[,-1]
if(result=="basis"){
- return(as.matrix(res)) # res is a matrix of dummy vectors
+ return(res) # res is a data.frame of dummy vectors
}
@@ -138,7 +138,7 @@
rownames(res) <- x at tip.label
colnames(res) <- paste("V",1:ncol(res))
- return(res)
+ return(as.data.frame(res))
} # end treePart
Modified: pkg/man/treePart.Rd
===================================================================
--- pkg/man/treePart.Rd 2008-12-12 18:13:58 UTC (rev 87)
+++ pkg/man/treePart.Rd 2008-12-12 18:24:42 UTC (rev 88)
@@ -3,24 +3,39 @@
\title{Define partitions of tips according from a tree}
\description{
The function \code{treePart} defines partitions of tips reflecting the
- topology of a tree. Each node but the root is translated into a dummy
+ topology of a tree. There are two possible outputs (handled by the
+ argument \code{result}):\cr
+ - \code{basis} mode: each node but the root is translated into a dummy
vector having one value for each tip: this value is '1' if the tip
descends from this node, and '0' otherwise.\cr
+ - \code{orthobasis}: in this mode, an orthonormal basis is derived
+ from the basis previously mentionned. This orthobasis was proposed in
+ the orthogram (Ollier \emph{et al.} 2006).
}
\usage{
-treePart(x)
+treePart(x, result=c("basis", "orthobasis"))
}
\arguments{
- \item{x}{A tree of class \code{\link[pkg:ape]{phylo}},
+ \item{x}{a tree of class \code{\link[pkg:ape]{phylo}},
\linkS4class{phylo4} or \linkS4class{phylo4d}.}
+ \item{result}{a character string specifying the type of result: either
+ a basis of dummy vectors (\code{basis}), or an orthobasis derived from these dummy vectors (\code{orthobasis}).}
}
\value{
- A data.frame of dummy vectors (in columns) having one value for each
+ A matrix of dummy vectors (in columns) having one value for each
tip (rows).
}
\author{ Thibaut Jombart \email{jombart at biomserv.univ-lyon1.fr} }
-\seealso{\code{\link{listDD}} which is called by \code{treePart}.
+\seealso{
+ - \code{\link{listDD}} which is called by \code{treePart}.\cr
+ - \code{\link{orthogram}}, which uses by default the orthobasis
+ produced by \code{treePart}.\cr
}
+\details{
+ Orthobasis produced by this function are identical to those stored in
+ the \$Bscores component of deprecated \link[pkg:ade4]{phylog} objects,
+ from the ade4 package.
+}
\examples{
if(require(ape) & require(phylobase)){
## make a tree
More information about the Adephylo-commits
mailing list