[Mattice-commits] r215 - pkg/inst/doc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Aug 31 16:40:54 CEST 2009
Author: andrew_hipp
Date: 2009-08-31 16:40:53 +0200 (Mon, 31 Aug 2009)
New Revision: 215
Modified:
pkg/inst/doc/maticce.Rnw
Log:
Fixing a couple of margin issues (tidying up vignette)
Modified: pkg/inst/doc/maticce.Rnw
===================================================================
--- pkg/inst/doc/maticce.Rnw 2009-08-31 14:23:54 UTC (rev 214)
+++ pkg/inst/doc/maticce.Rnw 2009-08-31 14:40:53 UTC (rev 215)
@@ -44,7 +44,8 @@
attach(carex) # attach dataset to search path
# convert the Bayes consensus to an ouchtree object...
ovales.tree <- ape2ouch(ovales.tree)
-# ... then convert the first 10 trees visited in the MCMC analysis to ouchtree objects
+# ... then convert the first 10 trees visited in the MCMC
+# analysis to ouchtree objects
trees <- lapply(ovales.bayesTrees[1:10], ape2ouch)
@
@@ -65,17 +66,19 @@
\begin{verbatim}
> nodes <- list(8) # assuming you want 8 nodes
> for(i in 1:length(nodes))
- > nodes[[i]] <- select.list(ovales.tree at nodelabels, multiple = T)
+ + nodes[[i]] <- select.list(ovales.tree at nodelabels,
+ + multiple = T)
\end{verbatim}
Alternatively, if you want to designate the node more quickly by just selecting the most recent common ancestor of a set of taxa:
\begin{verbatim}
> for(i in 1:length(nodes)) {
- > ancestor <-
- > mrcaOUCH(select.list(ovales.tree at nodelabels, multiple = T), ovales.tree)
- > nodes[[i]] <- nodeDescendents(ovales.tree, ancestor)
- > }
+ + ancestor <-
+ + mrcaOUCH(select.list(ovales.tree at nodelabels, multiple = T),
+ + ovales.tree)
+ + nodes[[i]] <- nodeDescendents(ovales.tree, ancestor)
+ + }
\end{verbatim}
These functions are all documented under \code{isMonophyletic}. Note that for many analyses that you might want to perform over a set of trees, you will need to determine for each tree whether each node of interest is present on the tree. There are alternative ways to do this (for example, a relatively new function in \pkg{ape} (\code{makeNodeLabel}) generates node labels by sorting and saving the descendents of each node to a file, then using \code{md5sum} to get a unique node label that uniquely identifies all the nodes in a tree with respect to its descendents. In \pkg{maticce}, node identity is checked automatically during batch analyses (see section Batch analyses below) by defining nodes based on their descendents, then checking for monophyly on each tree. For standard analyses in \pkg{maticce}, you do not have to worry about this yourself.
@@ -167,9 +170,11 @@
<<multiModel, fig=TRUE, echo=TRUE>>=
layout(matrix(1:9, 3, 3))
for(i in 1:8) {
- mm <- multiModel(carex[['ovales.tree']], ovales.data, ovales.nodes[[i]])
+ mm <- multiModel(carex[['ovales.tree']], ovales.data,
+ ovales.nodes[[i]])
pie(mm[['IC']][['BICwi']], labels = mm[['IC']][['names']],
- col = rainbow(length(mm[['IC']][['names']])), main = paste("Node",i,"BICwi"))
+ col = rainbow(length(mm[['IC']][['names']])),
+ main = paste("Node",i,"BICwi"))
}
@
More information about the Mattice-commits
mailing list