[Ecopd-commits] r60 - branches/single-tree/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Nov 9 19:09:14 CET 2009
Author: regetz
Date: 2009-11-09 19:09:14 +0100 (Mon, 09 Nov 2009)
New Revision: 60
Modified:
branches/single-tree/R/utilities.R
Log:
added function to return community names from a phylo4com object
Modified: branches/single-tree/R/utilities.R
===================================================================
--- branches/single-tree/R/utilities.R 2009-11-09 18:07:12 UTC (rev 59)
+++ branches/single-tree/R/utilities.R 2009-11-09 18:09:14 UTC (rev 60)
@@ -105,6 +105,11 @@
gsub("_.*$", "", tipLabels(phy))
}
+# community labels extractor
+communities <- function(phy) {
+ names(phy at metadata$comms)
+}
+
## this works as implementation of dist.nodes for phylo4 objects, albeit
## about 1.5x slower than dist.nodes
pairdist <- function(phy, type=c("all", "tip"), use.labels=FALSE) {
More information about the Ecopd-commits
mailing list