[Phylobase-commits] r422 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 3 18:26:42 CET 2009


Author: bbolker
Date: 2009-01-03 18:26:41 +0100 (Sat, 03 Jan 2009)
New Revision: 422

Modified:
   pkg/R/methods-phylo4.R
   pkg/man/nNodes-methods.Rd
   pkg/man/phylo4-class.Rd
   pkg/man/prune-methods.Rd
   pkg/man/reorder-methods.Rd
Log:
  added "drop.root" argument to edges() method
  cosmetic tweaks to man pages



Modified: pkg/R/methods-phylo4.R
===================================================================
--- pkg/R/methods-phylo4.R	2009-01-01 06:04:32 UTC (rev 421)
+++ pkg/R/methods-phylo4.R	2009-01-03 17:26:41 UTC (rev 422)
@@ -36,9 +36,10 @@
     nrow(x at edge)
 })
 
-setMethod("edges", "phylo4", function(x, order, ...) {
-    x at edge
-})
+setMethod("edges", "phylo4", function(x, order, drop.root=FALSE, ...) {
+  e <- x at edge
+  if (drop.root) e <- e[!is.na(e[,1]),]
+}
 
 setMethod("edgeOrder", "phylo4", function(x, ...) {
     x at order

Modified: pkg/man/nNodes-methods.Rd
===================================================================
--- pkg/man/nNodes-methods.Rd	2009-01-01 06:04:32 UTC (rev 421)
+++ pkg/man/nNodes-methods.Rd	2009-01-03 17:26:41 UTC (rev 422)
@@ -112,6 +112,7 @@
 % https://stat.ethz.ch/pipermail/r-devel/2008-May/049653.html
  \S4method{tdata}{phylo4d}(object, which = "tip", \dots) <- value
   \S4method{edgeLength}{phylo4}(x, which)
+\S4method{edges}{phylo4}(x, order, drop.root=FALSE, \dots)
 }
 \arguments{
   \item{which}{(tdata) which data to extract: "tip" (tips only), "node"
@@ -121,6 +122,8 @@
   \item{x}{a phylo4d object}
   \item{object}{a phylo4d object}
   \item{value}{a data frame}
+  \item{order}{(not yet implemented)}
+  \item{drop.root}{logical: drop root row from edge matrix?}
   \item{\dots}{for future development compatibility}
 }
 \examples{

Modified: pkg/man/phylo4-class.Rd
===================================================================
--- pkg/man/phylo4-class.Rd	2009-01-01 06:04:32 UTC (rev 421)
+++ pkg/man/phylo4-class.Rd	2009-01-03 17:26:41 UTC (rev 422)
@@ -3,8 +3,6 @@
 \alias{phylo4_orderings}
 \alias{phylo-class}
 \alias{phylo4-class}
-\alias{$,phylo4-method}
-\alias{$<-,phylo4-method}
 \alias{[,phylo4,ANY,missing,missing-method}
 \alias{print,phylo4-method}
 \alias{show,phylo4-method}
@@ -100,6 +98,7 @@
      NA,  8), ncol=2, byrow=TRUE) 
   
   P2 <- phylo4(E)
+  nodeLabels(P2) <- as.character(sort(nodeId(P2)))
   plot(P2, show.node.label=TRUE)
   sumryP2 <- summary(P2)
   sumryP2

Modified: pkg/man/prune-methods.Rd
===================================================================
--- pkg/man/prune-methods.Rd	2009-01-01 06:04:32 UTC (rev 421)
+++ pkg/man/prune-methods.Rd	2009-01-03 17:26:41 UTC (rev 422)
@@ -23,7 +23,7 @@
 }
 \note{At the moment, this simply wraps \code{ape::drop.tip}.
     Renamed from \code{drop.tip} to \code{prune} in order to
-    avoid conflicts with ape.}
+    avoid conflicts with \code{ape}.}
   \usage{
 \S4method{prune}{phylo4}(phy, tip, trim.internal = TRUE, subtree = FALSE,
                    root.edge = 0, \dots)

Modified: pkg/man/reorder-methods.Rd
===================================================================
--- pkg/man/reorder-methods.Rd	2009-01-01 06:04:32 UTC (rev 421)
+++ pkg/man/reorder-methods.Rd	2009-01-03 17:26:41 UTC (rev 422)
@@ -24,7 +24,6 @@
 orderIndex(phy, order = c('preorder','postorder'))
 }
 
-%- maybe also 'usage' for other objects documented here.
 \arguments{
   \item{phy}{a \code{phylo4} or \code{phylo4d} object}
   \item{x}{a \code{phylo4} or \code{phylo4d} object}
@@ -49,6 +48,4 @@
  \code{\link{ancestors}} \code{\link{ancestor}} \code{\link{siblings}}
  \code{\link{children}} \code{\link{descendants}}
 }
-% Add one or more standard keywords, see file 'KEYWORDS' in the
-% R documentation directory.
 \keyword{methods}



More information about the Phylobase-commits mailing list