[Adephylo-commits] r99 - in pkg: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Dec 13 19:08:12 CET 2008
Author: jombart
Date: 2008-12-13 19:08:12 +0100 (Sat, 13 Dec 2008)
New Revision: 99
Modified:
pkg/R/abouheif.R
pkg/man/abouheif.Rd
pkg/man/moranIdx.Rd
pkg/man/orthogram.Rd
pkg/man/ppca.Rd
Log:
Package almost finished. check does not pass. abouheif.moran still is messed up.
Modified: pkg/R/abouheif.R
===================================================================
--- pkg/R/abouheif.R 2008-12-13 17:25:58 UTC (rev 98)
+++ pkg/R/abouheif.R 2008-12-13 18:08:12 UTC (rev 99)
@@ -1,4 +1,5 @@
-abouheif.moran <- function (x, W=NULL, method=c("oriAbouheif","patristic","nNodes","Abouheif","sumDD"),
+abouheif.moran <- function (x, W=NULL,
+ method=c("oriAbouheif","patristic","nNodes","Abouheif","sumDD"),
a=1, nrepet=999,alter=c("greater", "less", "two-sided")) {
## some checks
@@ -44,6 +45,7 @@
restot = double (nrepet),
PACKAGE="adephylo"
)
- res <- as.krandtest(obs=res$obs,sim=matrix(res$result,ncol=nvar, byr=TRUE),names=test.names,alter=alter)
+ res <- as.krandtest(obs=res$obs,sim=matrix(res$result,ncol=nvar, byr=TRUE),
+ names=test.names,alter=alter)
return(res)
} # end abouheif.moran
Modified: pkg/man/abouheif.Rd
===================================================================
--- pkg/man/abouheif.Rd 2008-12-13 17:25:58 UTC (rev 98)
+++ pkg/man/abouheif.Rd 2008-12-13 18:08:12 UTC (rev 99)
@@ -23,9 +23,7 @@
}
\usage{
-abouheif.moran(x, W=NULL,
- method=c("oriAbouheif","patristic","nNodes","Abouheif","sumDD"),
- a=1, nrepet = 999, alter=c("greater", "less", "two-sided"))
+abouheif.moran(x, W=NULL, method=c("oriAbouheif","patristic","nNodes","Abouheif","sumDD"), a=1, nrepet = 999, alter=c("greater", "less", "two-sided"))
}
\arguments{
\item{x}{a data frame with continuous variables, or a
Modified: pkg/man/moranIdx.Rd
===================================================================
--- pkg/man/moranIdx.Rd 2008-12-13 17:25:58 UTC (rev 98)
+++ pkg/man/moranIdx.Rd 2008-12-13 18:08:12 UTC (rev 99)
@@ -37,9 +37,13 @@
between tips of a phylogeny.
}
\examples{
+## use maples dataset
+example(maples)
-## example(maples)
+## get a proximity matrix between tips
W <- proxTips(tre, met="Abouheif")
+
+## compute Moran's I for two traits (dom and bif)
moran.idx(dom, W)
moran.idx(bif, W)
moran.idx(rnorm(nTips(tre)), W)
Modified: pkg/man/orthogram.Rd
===================================================================
--- pkg/man/orthogram.Rd 2008-12-13 17:25:58 UTC (rev 98)
+++ pkg/man/orthogram.Rd 2008-12-13 18:08:12 UTC (rev 99)
@@ -81,18 +81,23 @@
names(afbw) <- tre$tip.label
names(neonatw) <- tre$tip.label
plot(afbw, neonatw) # relationship between traits
-abline(lm(neonatw~afbw))
-x <- phylo4d(tre, cbind.data.frame(afbw, neonatw)) # traits on the phylogeny
+lm1 <- lm(neonatw~afbw)
+resid <- residuals(lm1)
+abline(lm1)
-## default orthogram for trait afbw
-ung.phylog <- newick2phylog(ungulates$tre)
-orthogram(afbw, tre)
+## plot the two traits and the residuals of lm1
+x <- phylo4d(tre, cbind.data.frame(afbw, neonatw, residuals=resid))
+s.phylo4d(x) # residuals are surely not independant
-## using orthonormal basis derived from Abouheif's proximity
+## default orthogram for residuals of lm1
+orthogram(resid, tre)
+
+## using another orthonormal basis (derived from Abouheif's proximity)
myOrthoBasis <- orthobasis.phylo(tre, method="oriAbouheif") # Abouheif's proximities
-orthogram(afbw, ortho=myOrthoBasis)
+orthogram(resid, ortho=myOrthoBasis) # significant phylog. signal
-## orthogram for trait neonatw
-orthogram(neonatw, tre)
+## Abouheif's test
+W <- proxTips(tre, method="oriAbouheif") # proximity matrix
+abouheif.moran(resid, W)
}
Modified: pkg/man/ppca.Rd
===================================================================
--- pkg/man/ppca.Rd 2008-12-13 17:25:58 UTC (rev 98)
+++ pkg/man/ppca.Rd 2008-12-13 18:08:12 UTC (rev 99)
@@ -2,7 +2,10 @@
\name{ppca}
\alias{ppca}
\alias{print.ppca}
+\alias{summary.ppca}
\alias{scatter.ppca}
+\alias{screeplot.ppca}
+\alias{plot.ppca}
\title{Phylogenetic principal component analysis}
\description{These functions are designed to perform a phylogenetic principal
component analysis (pPCA, Jombart et al. in prep) and to display the
@@ -41,7 +44,7 @@
}
\arguments{
\item{x}{a \linkS4class{phylo4d} object (for \code{ppca}) or a ppca
- object (for \code{print} and \code{plot} methods).}
+ object (for other methods).}
\item{prox}{a marix of phylogenetic proximities as returned by
\code{\link{proxTips}}. If not provided, this matrix will be
constructed using the arguments \code{method} and \code{a}.}
@@ -68,6 +71,7 @@
('local structures').}
\item{\dots}{further arguments passed to other methods. Can be used to
provide arguments to \code{\link{s.phylo4d}} in \code{plot} method.}
+ \item{object}{a \code{ppca} object.}
\item{printres}{a logical stating whether results should be printed on
the screen (TRUE, default) or not (FALSE).}
\item{axes}{the index of the principal components to be represented.}
More information about the Adephylo-commits
mailing list