[Adephylo-commits] r107 - in pkg: . inst/doc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Dec 15 17:46:17 CET 2008
Author: jombart
Date: 2008-12-15 17:46:17 +0100 (Mon, 15 Dec 2008)
New Revision: 107
Modified:
pkg/TODO
pkg/inst/doc/adephylo.Rnw
Log:
Advances in vignette.
Modified: pkg/TODO
===================================================================
--- pkg/TODO 2008-12-15 15:13:44 UTC (rev 106)
+++ pkg/TODO 2008-12-15 16:46:17 UTC (rev 107)
@@ -80,6 +80,6 @@
o implement several phylogenetic proximities -- done (TJ)
o implement an orthobasis for phylogenies -- done (TJ)
* write a comprehensive tutorial, going through adephylo, ade4, ape, phylobase, etc.
-* new plotting / summary for ppca objects. Maybe move actual plot to a scatter method, and make a plot similar to other plots.
-* make a summary method for ppca.
+o new plotting / summary for ppca objects. Maybe move actual plot to a scatter method, and make a plot similar to other plots. -- done (TJ)
+o make a summary method for ppca. -- done (TJ)
Modified: pkg/inst/doc/adephylo.Rnw
===================================================================
--- pkg/inst/doc/adephylo.Rnw 2008-12-15 15:13:44 UTC (rev 106)
+++ pkg/inst/doc/adephylo.Rnw 2008-12-15 16:46:17 UTC (rev 107)
@@ -18,7 +18,14 @@
+%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
+%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%
+
+\SweaveOpts{prefix.string = figs/adephylo, fig = FALSE, eps = FALSE, pdf = TRUE, width = 6, height = 6}
+
This document describes the \code{adephylo} package for the R software.
\code{adephylo} aims at implementing exploratory methods for the
analysis of phylogenetic comparative data, i.e. biological traits measured for
@@ -39,6 +46,10 @@
analyse comparative data.
+
+
+
+
%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%
\section{First steps into \code{adephylo}}
@@ -126,10 +137,25 @@
Note that possibly conflicting, deprecated functions or datasets from \code{ade4} are
masked by \code{adephylo}.
+In case the converse would occur (i.e. deprecated function masking a
+function of \code{adephylo}), one can refer to the 'good' version of a
+function by adding the prefix \code{adephylo::} to the function,
+without space.
+Hence, it is possibly to coerce the version of a masked function,
+using a kludge like:
+<<kludge>>=
+cat("\\n=== Old - deprecated- version ===\\n")
+orthogram <- ade4::orthogram
+args(orthogram)
+cat("\\n=== New version === \\n")
+orthogram <- adephylo::orthogram
+args(orthogram)
+@
+Luckily, this should not be required as long as one is not playing
+with loading and unloading \code{ade4} once \code{adephylo} is loaded.
-
%%%%%%%%%%%%%%%%%%%%%
\subsection{Getting started}
%%%%%%%%%%%%%%%%%%%%%
@@ -152,4 +178,122 @@
+
+
+%%%%%%%%%%%%%%%%%%%%%
+\subsection{Putting data into shape}
+%%%%%%%%%%%%%%%%%%%%%
+While this is not the purpose of this document to go through the
+details of \code{phylo}, \code{phylo4} and \code{phylo4d} objects, we
+shall show briefly how these objects can be obtained.
+
+
+% % % % % % % % % % %
+\subsubsection{Making a \code{phylo} object}
+% % % % % % % % % % %
+The simplest way of turning a tree into a \code{phylo} object is using
+ape's function \code{read.tree}.
+This function reads a tree with the Newick (or 'parentetic') format,
+from a file (default, argument \code{file}) of from a character string
+(argument \code{text}).
+<<readTree, plot=TRUE>>=
+data(ungulates)
+ungulates$tre
+myTree <- read.tree(text=ungulates$tre)
+myTree
+plot(myTree, main="ape's plotting of a tree")
+@
+
+
+It is easy to convert \code{ade4}'s \code{phylog} objects to a
+\code{phylo}, as \code{phylog} objects store the Newick format of the
+tree in the \code{\$tre} component.
+\\
+
+Note that \code{phylo} trees can also be constructed from alignements
+(see \code{read.GenBankdist.dna}, \code{read.dna},
+\code{dist.dna}, \code{nj}, \code{bionj}, and \code{mlphylo}, all in
+\code{ape}), or even simulated (for instance, see \code{rtree}).
+\\
+
+Also note that, if needed, conversion can be done back and forward
+with \code{phylo4} trees:
+<<>>=
+temp <- as(myTree, "phylo4")
+class(temp)
+temp <- as(temp, "phylo")
+class(temp)
+all.equal(temp, myTree)
+@
+
+
+
+
+
+% % % % % % % % % % %
+\subsubsection{Making a \code{phylo4d} object}
+% % % % % % % % % % %
+\code{phylo4d} objects are S4 objects, and are thus created in a
+particular way.
+The most immediate way of creating a \code{phylo4d} object is to call
+to the constructor, also named \code{phylo4d}.
+This is a function that takes two arguments: a tree (\code{phylo} or
+\code{phylo4} format) and a data.frame containing data, for tips by
+default (see \code{?phylo4d} for more information).
+Here is an example:
+<<phylo4d, fig=TRUE>>=
+ung <- phylo4d(myTree, ungulates$tab)
+class(ung)
+table.phylo4d(ung)
+@
+
+\noindent Note that the constructor checks the consistency of the
+names used for the tips of the tree and for the rows of the data.frame.
+Inconsistencies issue an error.
+To override this behaviour, one can specify
+\code{use.tip.names=FALSE}.
+However, this can be tricky: often, mismatches between names can
+indicate that data are not sorted adequately; moreover, object created
+with such mismatches will often be invalid objects, and may issue
+errors in further analyses.
+
+
+
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%
+\section{Exploratory data analysis}
+%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%
+\subsection{Quantifying and testing phylogenetic signal}
+%%%%%%%%%%%%%%%%%%%%%
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%
+\subsection{Modelling phylogenetic signal}
+%%%%%%%%%%%%%%%%%%%%%
+
+
+
+%%%%%%%%%%%%%%%%%%%%%
+\subsection{Using multivariate analyses}
+%%%%%%%%%%%%%%%%%%%%%
+
+
+
+%%%%%%%%%%%%%%%%%%%%%
+\subsection{Performing a phylogenetic Principal Component Analysis}
+%%%%%%%%%%%%%%%%%%%%%
+
+
+
+
\end{document}
More information about the Adephylo-commits
mailing list