[Phylobase-commits] r663 - branches/slot-mods/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 23 07:44:57 CEST 2009
Author: regetz
Date: 2009-09-23 07:44:57 +0200 (Wed, 23 Sep 2009)
New Revision: 663
Modified:
branches/slot-mods/R/class-phylo4.R
branches/slot-mods/R/methods-phylo4.R
Log:
addendum to r660: updated 'labels<-' and .createLabels arguments (and
one test) to reflect new default type for label replacement
Modified: branches/slot-mods/R/class-phylo4.R
===================================================================
--- branches/slot-mods/R/class-phylo4.R 2009-09-23 05:09:38 UTC (rev 662)
+++ branches/slot-mods/R/class-phylo4.R 2009-09-23 05:44:57 UTC (rev 663)
@@ -21,12 +21,12 @@
#####################
.createLabels <- function(value, ntips, nnodes, use.names = TRUE,
- type = c("tip", "internal", "allnode")) {
+ type = c("all", "tip", "internal")) {
type <- match.arg(type)
## set up final length of object to return
- lgthRes <- switch(type, tip=ntips, internal=nnodes, allnode=ntips+nnodes)
+ lgthRes <- switch(type, tip=ntips, internal=nnodes, all=ntips+nnodes)
## create NA character vector of node labels
res <- character(lgthRes)
@@ -36,7 +36,7 @@
names(res) <- switch(type,
tip = 1:ntips,
internal = seq(from=ntips+1, length=lgthRes),
- allnode = 1:(ntips+nnodes))
+ all = 1:(ntips+nnodes))
## if no values are provided
Modified: branches/slot-mods/R/methods-phylo4.R
===================================================================
--- branches/slot-mods/R/methods-phylo4.R 2009-09-23 05:09:38 UTC (rev 662)
+++ branches/slot-mods/R/methods-phylo4.R 2009-09-23 05:44:57 UTC (rev 663)
@@ -265,7 +265,7 @@
setReplaceMethod("labels",
signature(x="phylo4", type="ANY",
use.names="ANY", value="character"),
- function(x, type = c("tip", "internal", "allnode"),
+ function(x, type = c("all", "tip", "internal"),
use.names, ..., value) {
## Default options
More information about the Phylobase-commits
mailing list