[Phylobase-commits] r133 - in pkg: . R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Mar 2 23:15:38 CET 2008
Author: skembel
Date: 2008-03-02 23:15:38 +0100 (Sun, 02 Mar 2008)
New Revision: 133
Modified:
pkg/R/phylo4.R
pkg/TODO
Log:
Modified labels method to optionally return tips, int. nodes or all labels
Modified: pkg/R/phylo4.R
===================================================================
--- pkg/R/phylo4.R 2008-02-29 19:37:39 UTC (rev 132)
+++ pkg/R/phylo4.R 2008-03-02 22:15:38 UTC (rev 133)
@@ -158,6 +158,12 @@
object at tip.label
})
+setMethod("labels","phylo4", function(object,which=c("tip","node","allnode"),...) {
+ which <- match.arg(which)
+ switch(which,tip=object at tip.label,node=object at node.label,
+ allnode=c(object at tip.label,object at node.label))
+})
+
setGeneric("labels<-",
function(object,...,value) {
standardGeneric("labels<-")
@@ -168,7 +174,6 @@
object
})
-
setGeneric("NodeLabels", function(x) {
standardGeneric("NodeLabels")
})
Modified: pkg/TODO
===================================================================
--- pkg/TODO 2008-02-29 19:37:39 UTC (rev 132)
+++ pkg/TODO 2008-03-02 22:15:38 UTC (rev 133)
@@ -16,6 +16,7 @@
## Data classes
### Tree model:
* assigning edge and node labels -- is there/should there be an option to turn this off? assign empty ("") labels? how about assigning the node number if there are no user-supplied labels?(mb)
+* basic checks when assigning labels (do number of labels and number of nodes/tips match?)
* should default node labels start at N(nTips+1), to match internal node numbers?
* should coercing phylo4d to phylo4 give a warning message about losing data? Should phylo4d to phylo4? Yes(mb)
* order: All phylo4 edge matrices are internally stored as "cladewise"/Newick traversal order. Extend edges accessor method with optional argument that allows edges to be extracted in a different order (possibly with an attribute as in ape); need to steal 'reorder' from ape, extend for phylo4d keeping track of traits also see ape::ladderize
More information about the Phylobase-commits
mailing list