[Phylobase-commits] r899 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 8 17:06:22 CEST 2014


Author: francois
Date: 2014-04-08 17:06:21 +0200 (Tue, 08 Apr 2014)
New Revision: 899

Modified:
   pkg/R/nodeId-methods.R
Log:
added/formated documentation for nodeId and edgeId

Modified: pkg/R/nodeId-methods.R
===================================================================
--- pkg/R/nodeId-methods.R	2014-04-01 02:05:08 UTC (rev 898)
+++ pkg/R/nodeId-methods.R	2014-04-08 15:06:21 UTC (rev 899)
@@ -1,6 +1,37 @@
 
+##' nodeId methods
+##'
+##' These functions gives the node (\code{nodeId}) or edge
+##' (\code{edgeId}) identity.
+##'
+##' \code{nodeId} returns the node in ascending order, and
+##' \code{edgeId} in the same order as the edges are stored in the
+##' edge matrix.
+##' 
+##' @param x a \code{phylo4} or \code{phylo4d} object.
+##' @param type a character vector indicating which subset of the
+##' nodes or edges you are interested in.
+##' @return \describe{
+##'   \item{nodeId}{an integer vector  indicating node numbers}
+##'   \item{edgeId}{a character vector indicating the edge identity}
+##' }
+##' @export
+##' @docType methods
+##' @rdname nodeId-methods
+##' @include phylo4-class.R phylo4-methods.R phylo4-accessors.R root-methods.R
+##' @examples
+##'   data(geospiza)
+##'   identical(nodeId(geopsiza, "tip"), 1:nTips(geospiza))
+##'   nodeId(geospiza, "internal")
+##'   edgeId(geospiza, "internal")
+##'   nodeId(geospiza, "root")
+setGeneric("nodeId", function(x, type=c("all", "tip", "internal",
+    "root")) {
+    standardGeneric("nodeId")
+})
 
-# return node IDs (or a subset thereof) in ascending order
+##' @rdname nodeId-methods
+##' @aliases nodeId,phylo4-method
 setMethod("nodeId", signature(x="phylo4"),
  function(x, type=c("all",
     "tip","internal","root")) {
@@ -28,7 +59,17 @@
 
 })
 
-# return edge IDs (or a subset thereof) in edge matrix order
+#### ----- edgeId
+
+##' @rdname nodeId-methods
+##' @aliases edgeId
+setGeneric("edgeId", function(x, type=c("all", "tip", "internal",
+    "root")) {
+    standardGeneric("edgeId")
+})
+
+##' @rdname nodeId-methods
+##' @aliases edgeId,phylo4-method
 setMethod("edgeId", signature(x="phylo4"),
  function(x, type=c("all", "tip",
     "internal", "root")) {



More information about the Phylobase-commits mailing list