[Picante-commits] r42 - / pkg/R pkg/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 25 07:26:26 CET 2008


Author: skembel
Date: 2008-03-25 07:26:26 +0100 (Tue, 25 Mar 2008)
New Revision: 42

Added:
   pkg/man/utility.Rd
Removed:
   pkg/man/internal2tips.Rd
   pkg/man/node.age.Rd
   pkg/man/sortColumns.Rd
   pkg/man/sortRows.Rd
   pkg/man/t2p2t.Rd
Modified:
   TODO
   pkg/R/internal2tips.R
   pkg/man/phylosignal.Rd
   pkg/man/ses.mnnd.Rd
   pkg/man/ses.mpd.Rd
Log:
CLeanup of documentation, moved utility functions into a single help file

Modified: TODO
===================================================================
--- TODO	2008-03-05 23:59:33 UTC (rev 41)
+++ TODO	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,21 +1,23 @@
 TODO list for picante package
 
-General notes: Many functions are untested or outright broken. Do not use any of these functions for 'real' analysis without getting in touch with a project developer first.
+General notes: Many functions are untested. Do not use any of these functions for 'real' analysis without getting in touch with a project developer first.
 
 TODO
 ====
 For 0.1
 -------
 -fix trait data input - currently most functions expect a vector with names, should handle/check lack of names and warn
--allow trait data to be a vector or a data.frame (single or multiple columns) (maybe for 0.2?)
--clean up/hide utility functions, merge into one file
--merge community structure and phylocom functions into one file?
+-clean up/hide utility functions, merge into one file/documentation
+-merge community structure and phylocom functions into one file
+-reinstate function to call out to phylocom executable and read results back in to R (maybe for 0.2?)
+-improve documentation especially for ses.mpd, ses.mnnd, phylosignal, ?
 
 For 0.2
 -------
 -implement null model heavy lifting in C code - see BB's email for a start
--implement contrib index and similar
+-allow trait data to be a vector or a data.frame (single or multiple columns)
+-implement contrib index and similar - move to phylobase format?
 -qr on comdist as option
 -trait gradient analysis and contrast diagnostics functions from DDA
 -taxaShuffle and comstruct functions - rewrite to use indices in place of names for efficiency
-
+-vignettes

Modified: pkg/R/internal2tips.R
===================================================================
--- pkg/R/internal2tips.R	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/R/internal2tips.R	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,25 +1,25 @@
 `internal2tips` <-
-function(x,int.node,return.names=FALSE) {
-	# x = phy object
+function(phy,int.node,return.names=FALSE) {
+	# phy = phy object
 	# int.node = number or name of internal node
-	Ntaxa = length(x$tip.label)
-	Nnode = x$Nnode
-	if ((Ntaxa+Nnode-1)!=nrow(x$edge)) {
+	Ntaxa = length(phy$tip.label)
+	Nnode = phy$Nnode
+	if ((Ntaxa+Nnode-1)!=nrow(phy$edge)) {
 		print('tree structure error')
 		break
 	}
 
 	# if necessary convert int.node to a node number for an internal node
-	if (mode(int.node)=='character') nodes = which(x$node.label==int.node)+Ntaxa else nodes = int.node
+	if (mode(int.node)=='character') nodes = which(phy$node.label==int.node)+Ntaxa else nodes = int.node
 
 	tips = c()
 	repeat {
-		nodes = x$edge[which(x$edge[,1]%in%nodes),2]
+		nodes = phy$edge[which(phy$edge[,1]%in%nodes),2]
 		if (length(nodes)==0) break
 		tips = c(tips,nodes)
 	}
 	tips = tips[tips<=Ntaxa]
-	if (return.names) tips = x$tip.label[tips]
+	if (return.names) tips = phy$tip.label[tips]
 	return(tips)
 }
 

Deleted: pkg/man/internal2tips.Rd
===================================================================
--- pkg/man/internal2tips.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/internal2tips.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,22 +0,0 @@
-\name{internal2tips}
-\alias{internal2tips}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ Tips descended from a node }
-\description{
-  Tips descended from a node
-}
-\usage{
-internal2tips(x, int.node, return.names = FALSE)
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
-  \item{x}{ phylo object }
-  \item{int.node}{ internal node number }
-  \item{return.names}{ TRUE or FALSE }
-}
-\value{
-  Vector of tips descended from a node
-}
-
-\author{ David Ackerly <dackerly at berkeley.edu> }
-\keyword{manip}

Deleted: pkg/man/node.age.Rd
===================================================================
--- pkg/man/node.age.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/node.age.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,21 +0,0 @@
-\name{node.age}
-\alias{node.age}
-
-\title{ Node ages }
-\description{
-  Node ages based on branch lengths
-}
-\usage{
-node.age(phy)
-}
-%- maybe also 'usage' for other objects documented here.
-\arguments{
-  \item{phy}{ phylo object }
-}
-
-\value{
-  Phylo object with phylo\$ages vector of node ages corresponding to phylo\$edge
-}
-
-\author{ David Ackerly <dackerly at berkeley.edu> }
-\keyword{misc}

Modified: pkg/man/phylosignal.Rd
===================================================================
--- pkg/man/phylosignal.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/phylosignal.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,7 +1,7 @@
 \name{phylosignal}
 \alias{phylosignal}
 %- Also NEED an '\alias' for EACH other topic documented here.
-\title{ Metrics of phylogenetic signal }
+\title{ Measure phylogenetic signal }
 \description{
   Calculates K statistic of phylogenetic signal as well as P-value based on variance of phylogenetically independent contrasts relative to tip shuffling randomization.
 }

Modified: pkg/man/ses.mnnd.Rd
===================================================================
--- pkg/man/ses.mnnd.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/ses.mnnd.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -7,7 +7,7 @@
   Nearest Taxon Index of community phylogenetic structure
 }
 \usage{
-nti(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+ses.mnnd(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
 }
 
 \arguments{

Modified: pkg/man/ses.mpd.Rd
===================================================================
--- pkg/man/ses.mpd.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/ses.mpd.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -7,7 +7,7 @@
   Net Relatedness Index of community phylogenetic structure
 }
 \usage{
-nri(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
+ses.mpd(samp, phylo.dist, null.model = c("taxa.labels", "sample.pool", "phylogeny.pool", "weighted.sample.pool"), runs = 99)
 }
 %- maybe also 'usage' for other objects documented here.
 \arguments{

Deleted: pkg/man/sortColumns.Rd
===================================================================
--- pkg/man/sortColumns.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/sortColumns.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,21 +0,0 @@
-\name{sortColumns}
-\alias{sortColumns}
-
-\title{ Sort columns of a data frame or matrix}
-\description{
-  Utility function to sort columns of a data frame or matrix
-}
-\usage{
-sortColumns(x)
-}
-
-\arguments{
-  \item{x}{ Data frame or matrix }
-}
-
-\value{
-  Sorted data frame or matrix
-}
-
-\author{ Steve Kembel <skembel at berkeley.edu> }
-\keyword{manip}

Deleted: pkg/man/sortRows.Rd
===================================================================
--- pkg/man/sortRows.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/sortRows.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,20 +0,0 @@
-\name{sortRows}
-\alias{sortRows}
-\title{ Sort rows of a data frame or matrix}
-\description{
-  Utility function to sort rows of a data frame or matrix
-}
-\usage{
-sortRows(x)
-}
-
-\arguments{
-  \item{x}{ Data frame or matrix }
-}
-
-\value{
-  Sorted data frame or matrix
-}
-
-\author{ Steve Kembel <skembel at berkeley.edu> }
-\keyword{manip}

Deleted: pkg/man/t2p2t.Rd
===================================================================
--- pkg/man/t2p2t.Rd	2008-03-05 23:59:33 UTC (rev 41)
+++ pkg/man/t2p2t.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -1,26 +0,0 @@
-\name{t2p2t}
-\alias{t2p2t}
-%- Also NEED an '\alias' for EACH other topic documented here.
-\title{ List of non-matching species from phylo and trait data objects }
-\description{
-  List of non-matching species from phylo and trait data objects
-}
-\usage{
-t2p2t(phy, species)
-}
-
-\arguments{
-  \item{phy}{ phylo object }
-  \item{species}{ Vector of species names }
-}
-
-\value{
-  ~Describe the value returned
-  If it is a LIST, use
-  \item{missing.from.phy:}{Species in trait but not phylo}
-  \item{missing.from.species: }{Species in phylo but not trait}
-  ...
-}
-
-\author{ David Ackerly <dackerly at berkeley.edu> }
-\keyword{manip}

Added: pkg/man/utility.Rd
===================================================================
--- pkg/man/utility.Rd	                        (rev 0)
+++ pkg/man/utility.Rd	2008-03-25 06:26:26 UTC (rev 42)
@@ -0,0 +1,45 @@
+\name{utility}
+\alias{t2p2t}
+\alias{df2vec}
+\alias{internal2tips}
+\alias{node.age}
+\alias{phylo2phylog}
+\alias{sortColumns}
+\alias{sortRows}
+\title{ Picante utility functions }
+\description{
+  Picante utility functions for tree and data manipulation
+}
+\usage{
+df2vec(x, colID=1)
+internal2tips(phy, int.node, return.names = FALSE)
+node.age(phy)
+phylo2phylog(phy, ...)
+sortColumns(x)
+sortRows(x)
+t2p2t(phy, species)
+}
+
+\arguments{
+    \item{phy}{ phylo object }
+    \item{species}{ Vector of species names }
+    \item{x}{ A data.frame or matrix }
+    \item{colID}{ Numeric or character ID of column to include }
+  \item{int.node}{ internal node number }
+  \item{return.names}{ TRUE or FALSE }
+  \item{...}{Additional arguments}
+}
+
+\value{
+  \item{df2vec}{A named vector}
+  \item{t2p2t}{List of species missing from phylo and vice versa}
+  \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{sortColumns}{A data.frame or matrix with columns sorted by name}
+  \item{sortRows}{A data.frame or matrix with rows sorted by name}
+  
+}
+
+\author{ Steven Kembel <skembel at berkeley.edu>, David Ackerly <dackerly at berkeley.edu> }
+\keyword{manip}



More information about the Picante-commits mailing list