[Picante-commits] r53 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 13 08:30:41 CEST 2008


Author: skembel
Date: 2008-04-13 08:30:41 +0200 (Sun, 13 Apr 2008)
New Revision: 53

Added:
   pkg/R/cor.table.R
   pkg/man/cor.table.Rd
Removed:
   pkg/R/corr.table.R
   pkg/man/corr.table.Rd
Modified:
   pkg/R/utility.R
   pkg/man/mnnd.Rd
   pkg/man/mpd.Rd
   pkg/man/phylocom.Rd
   pkg/man/randomizeSample.Rd
   pkg/man/ses.mnnd.Rd
   pkg/man/ses.mpd.Rd
   pkg/man/species.dist.Rd
   pkg/man/utility.Rd
Log:
Documentation and minor code bugfixes to pass check cleanly

Added: pkg/R/cor.table.R
===================================================================
--- pkg/R/cor.table.R	                        (rev 0)
+++ pkg/R/cor.table.R	2008-04-13 06:30:41 UTC (rev 53)
@@ -0,0 +1,20 @@
+cor.table <- function (x, cor.method = "pearson", cor.type=c("standard","contrast")) 
+{
+    cor.type <- match.arg(cor.type)
+    if (identical(cor.type,"standard")) {
+        concorr <- list()
+        concorr$r <- cor(x, method = cor.method)
+        concorr$df <- dim(x)[1] - 2
+        t <- concorr$r * sqrt(concorr$df/(1 - concorr$r^2))
+        concorr$P <- dt(t, concorr$df)
+        concorr
+    }
+    else {
+    	concorr <- list()
+        concorr$r <- cor(rbind(x,x*-1),method=cor.method)
+        concorr$df <- length(x[,1])-1
+        t <- concorr$r * sqrt(concorr$df/(1-concorr$r^2))
+        concorr$P <- dt(t,concorr$df)
+        concorr
+    }
+}

Deleted: pkg/R/corr.table.R
===================================================================
--- pkg/R/corr.table.R	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/R/corr.table.R	2008-04-13 06:30:41 UTC (rev 53)
@@ -1,20 +0,0 @@
-corr.table <- function (x, cor.method = "pearson", cor.type=c("standard","contrast")) 
-{
-    cor.type <- match.arg(cor.type)
-    if (identical(cor.type,"standard")) {
-        concorr <- list()
-        concorr$r <- cor(x, method = cor.method)
-        concorr$df <- dim(x)[1] - 2
-        t <- concorr$r * sqrt(concorr$df/(1 - concorr$r^2))
-        concorr$P <- dt(t, concorr$df)
-        concorr
-    }
-    else {
-    	concorr <- list()
-        concorr$r <- cor(rbind(x,x*-1),method=cor.method)
-        concorr$df <- length(x[,1])-1
-        t <- concorr$r * sqrt(concorr$df/(1-concorr$r^2))
-        concorr$P <- dt(t,concorr$df)
-        concorr
-    }
-}

Modified: pkg/R/utility.R
===================================================================
--- pkg/R/utility.R	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/R/utility.R	2008-04-13 06:30:41 UTC (rev 53)
@@ -2,8 +2,8 @@
 	# some data input error checking, all taxa in tree and x
 	# no missing data values
 	stopifnot(traitcol %in% names(x), taxacol %in% names(x),
-		class(x) == "data.frame", class(phylo) == "phylo")
-	len.tips <- length(phylo$tip.label)
+		class(x) == "data.frame", class(phy) == "phylo")
+	len.tips <- length(phy$tip.label)
 	len.taxa <- length(x[,taxacol])
 	if (any(missing <- !(phy$tip.label %in% x[, taxacol]))) {
 		stop("ERROR. phylogeny tip(s): ", phy$tip.label[missing], 

Added: pkg/man/cor.table.Rd
===================================================================
--- pkg/man/cor.table.Rd	                        (rev 0)
+++ pkg/man/cor.table.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -0,0 +1,26 @@
+\name{cor.table}
+\alias{cor.table}
+\title{ Table of correlations and P-values }
+\description{
+  Table of correlations with associated P-values and df, can be used with regular or independent contrast data
+}
+\usage{
+cor.table(x, cor.method = "pearson", cor.type=c("standard","contrast")) 
+}
+%- maybe also 'usage' for other objects documented here.
+\arguments{
+  \item{x}{ Data frame of data points or contrasts at nodes }
+  \item{cor.method}{ Correlation method (as \code{\link{cor}}) }
+  \item{cor.type}{ Are data \code{standard} or independent \code{contrast} values?}
+}
+
+\value{
+  \item{r}{Correlation values}
+  \item{df}{Degrees of freedom}
+  \item{P}{P-values}
+}
+
+\references{ Garland et al. 1992 }
+
+\author{ Steve Kembel <skembel at berkeley.edu> }
+\keyword{univar}

Deleted: pkg/man/corr.table.Rd
===================================================================
--- pkg/man/corr.table.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/corr.table.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -1,17 +0,0 @@
-\name{corr.table}
-\alias{corr.table}
-\title{ Table of PIC correlations }
-\description{
-  Table of PIC correlations with corrected P-values and df
-}
-\usage{
-corr.table(nodes, cor.method = "pearson")
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
-  \item{nodes}{ Data frame of standardized contrasts at nodes }
-  \item{cor.method}{ Correlation method (as \code{\link{cor}}) }
-}
-
-\author{ Steve Kembel <skembel at berkeley.edu> }
-\keyword{univar}

Modified: pkg/man/mnnd.Rd
===================================================================
--- pkg/man/mnnd.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/mnnd.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -1,17 +1,17 @@
 \name{mnnd}
 \alias{mnnd}
 %- Also NEED an '\alias' for EACH other topic documented here.
-\title{ Mean nearest relative phylogenetic distance }
+\title{ Mean nearest neighbour distance }
 \description{
-  Calculates MNND (mean nearest neighbour or relative phylogenetic distance) for a community 
+  Calculates MNND (mean nearest neighbour distance) for a community
 }
 \usage{
-mnnd(samp, phy.dist)
+mnnd(samp, dis)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
   \item{samp}{ Phylocom sample file }
-  \item{phy.dist}{ Cophenetic phylogenetic distance matrix }
+  \item{dis}{ Interspecific (e.g. phylogenetic) distance matrix }
 }
 \value{
 	Vector of MNND values for each community

Modified: pkg/man/mpd.Rd
===================================================================
--- pkg/man/mpd.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/mpd.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -1,16 +1,16 @@
 \name{mpd}
 \alias{mpd}
-\title{ Mean pairwise phylogenetic distance }
+\title{ Mean pairwise distance }
 \description{
-  Calculates mean pairwise phylogenetic distance for a community
+  Calculates mean pairwise distance for a community
 }
 \usage{
-mpd(samp, phy.dist)
+mpd(samp, dis)
 }
 
 \arguments{
   \item{samp}{ Community data matrix }
-  \item{phy.dist}{ Cophenetic phylogenetic distance matrix }
+  \item{dis}{ Interspecific (e.g. phylogenetic) distance matrix }
 }
 
 \value{

Modified: pkg/man/phylocom.Rd
===================================================================
--- pkg/man/phylocom.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/phylocom.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -8,9 +8,9 @@
 \usage{data(phylocom)}
 \format{
 A list with three elements
-  \item{phylocom$phylo}{Phylogenetic tree}
-  \item{phylocom$sample}{Community data}
-  \item{phylocom$traits}{Trait data}
+  \item{phylocom\$phylo}{Phylogenetic tree}
+  \item{phylocom\$sample}{Community data}
+  \item{phylocom\$traits}{Trait data}
 }
 
 \source{

Modified: pkg/man/randomizeSample.Rd
===================================================================
--- pkg/man/randomizeSample.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/randomizeSample.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -6,7 +6,7 @@
   Various null models for randomizing community data matrices
 }
 \usage{
-randomizeSample(samp, null.model = c("keepFreq", "keepRichness", "keepBoth"))
+randomizeSample(samp, null.model = c("frequency", "richness", "both"))
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{

Modified: pkg/man/ses.mnnd.Rd
===================================================================
--- pkg/man/ses.mnnd.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/ses.mnnd.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -7,12 +7,12 @@
   Nearest Taxon Index of community phylogenetic structure
 }
 \usage{
-ses.mnnd(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+ses.mnnd(samp, dis, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
 }
 
 \arguments{
   \item{samp}{ Community data matrix }
-  \item{phylo.dist}{ Cophenetic phylogenetic distance matrix }
+  \item{dis}{ Cophenetic phylogenetic distance matrix }
   \item{null.model}{ Choice of null models }
   \item{runs}{ Number of randomizations }
 }

Modified: pkg/man/ses.mpd.Rd
===================================================================
--- pkg/man/ses.mpd.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/ses.mpd.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -7,12 +7,12 @@
   Net Relatedness Index of community phylogenetic structure
 }
 \usage{
-ses.mpd(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+ses.mpd(samp, dis, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{
   \item{samp}{ Community data matrix }
-  \item{phylo.dist}{ Cophenetic phylogenetic distance matrix }
+  \item{dis}{ Cophenetic phylogenetic distance matrix }
   \item{null.model}{ Choice of null models }
   \item{runs}{ Number of randomizations }
 }

Modified: pkg/man/species.dist.Rd
===================================================================
--- pkg/man/species.dist.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/species.dist.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -5,12 +5,13 @@
 \description{
   Compute various indices of species co-occurrence
 }
+
 \usage{
-species.dist(samp, metric = c("cij", "jaccard", "roij"))
+species.dist(x, metric = c("cij", "jaccard", "checkerboard", "roij"))
 }
 
 \arguments{
-  \item{samp}{ Community data matrix }
+  \item{x}{ Community data matrix }
   \item{metric}{ Distance metric to use (COij, Jaccard, ROij) }
 }
 

Modified: pkg/man/utility.Rd
===================================================================
--- pkg/man/utility.Rd	2008-04-13 02:50:56 UTC (rev 52)
+++ pkg/man/utility.Rd	2008-04-13 06:30:41 UTC (rev 53)
@@ -3,6 +3,7 @@
 \alias{internal2tips}
 \alias{node.age}
 \alias{phylo2phylog}
+\alias{pic.variance}
 \alias{sortColumns}
 \alias{sortRows}
 \alias{taxaShuffle}
@@ -16,6 +17,7 @@
 internal2tips(phy, int.node, return.names = FALSE)
 node.age(phy)
 phylo2phylog(phy, ...)
+pic.variance(x, phy, scaled = TRUE)
 sortColumns(x)
 sortRows(x)
 taxaShuffle(x)
@@ -24,12 +26,11 @@
 
 \arguments{
     \item{phy}{ phylo object }
-    \item{species}{ Vector of species names }
     \item{x}{ A data.frame, matrix or dist object }
     \item{colID}{ Numeric or character ID of column to include }
   \item{int.node}{ internal node number }
   \item{return.names}{ TRUE or FALSE }
-  \item{strata}{ Strata for randomization }  
+  \item{scaled}{ Scale contrasts by branch length }
   \item{taxacol} {column with taxa names}
   \item{traitcol} {column with trait values}
   \item{strict} {logical indicating whether matching should be strict or not}
@@ -42,6 +43,7 @@
   \item{internal2tips}{Vector of tips descended from a node}
   \item{node.age}{Phylo object with phylo\$ages vector of node ages corresponding to phylo\$edge}
   \item{phylo2phylog}{An ade4 phylog}
+  \item{pic.variance}{Variance of independent contrasts}
   \item{sortColumns}{A data.frame or matrix with columns sorted by name}
   \item{sortRows}{A data.frame or matrix with rows sorted by name}
     \item{taxaShuffle}{Matrix with taxa names shuffled}



More information about the Picante-commits mailing list