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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Feb 17 18:29:32 CET 2008


Author: jombart
Date: 2008-02-17 18:29:32 +0100 (Sun, 17 Feb 2008)
New Revision: 112

Modified:
   pkg/R/phylo4.R
   pkg/man/phylo4d.Rd
Log:
Columns of $edge are named as ancestor and descendent.


Modified: pkg/R/phylo4.R
===================================================================
--- pkg/R/phylo4.R	2008-02-16 03:37:14 UTC (rev 111)
+++ pkg/R/phylo4.R	2008-02-17 17:29:32 UTC (rev 112)
@@ -13,7 +13,7 @@
                         tip.label="character",
                         edge.label="character",
                         root.edge="numeric"),
-         prototype=list(edge=matrix(nrow=0,ncol=2),
+         prototype=list(edge=matrix(nrow=0,ncol=2,dimname=list(NULL,c("ancestor","descendent"))),
            edge.length=numeric(0),
            Nnode=as.integer(0),
            tip.label=character(0),
@@ -591,6 +591,7 @@
     if(any(is.na(edge))) stop("NA are not allowed in edge matrix")
     if(ncol(edge)>2) warning("the edge matrix has more than two columns")
     edge <- as.matrix(edge[,1:2])
+    colnames(edge) <- c("ancestor","desendent")
     
     ## edge.length
     if(!is.null(edge.length)) {

Modified: pkg/man/phylo4d.Rd
===================================================================
--- pkg/man/phylo4d.Rd	2008-02-16 03:37:14 UTC (rev 111)
+++ pkg/man/phylo4d.Rd	2008-02-17 17:29:32 UTC (rev 112)
@@ -56,6 +56,9 @@
 library(ape)
 example(read.tree)
 try(phylo4d(as(tree.owls.bis,"phylo4"),data.frame(wing=1:3)), silent=TRUE)
-phylo4d(as(tree.owls.bis,"phylo4"),data.frame(wing=1:3), use.tip.names=FALSE)
+obj <- phylo4d(as(tree.owls.bis,"phylo4"),data.frame(wing=1:3),
+use.tip.names=FALSE)
+obj
+print(obj)
 }
 \keyword{misc}



More information about the Phylobase-commits mailing list