R Under development (unstable) (2024-01-28 r85838 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(phylobase) > library(ape) Attaching package: 'ape' The following object is masked from 'package:phylobase': edges > > set.seed(1) > r1 <- rcoal(5) > > ## trace("phylo4d", browser, signature = "phylo") > ## untrace("phylo4d", signature = "phylo") > tipdat <- data.frame(a=1:5,row.names=r1$tip.label) > p1 <- phylo4d(r1,tip.data=tipdat,node.data=data.frame(a=6:9), match.data=FALSE) > p2 <- prune(p1,1) > summary(p2) Phylogenetic tree : as(x, "phylo4") Number of tips : 4 Number of nodes : 3 Branch lengths: mean : 0.252522 variance : 0.02063627 distribution : Min. 1st Qu. Median Mean 3rd Qu. Max. 0.04857 0.17296 0.27246 0.25252 0.30889 0.46082 Comparative data: Tips: data.frame with 4 taxa and 1 variable(s) a Min. :2.00 1st Qu.:2.75 Median :3.50 Mean :3.50 3rd Qu.:4.25 Max. :5.00 Nodes: data.frame with 3 internal nodes and 1 variables a Min. :6.0 1st Qu.:6.5 Median :7.0 Mean :7.0 3rd Qu.:7.5 Max. :8.0 > > ## from picante > `phylo2phylog` <- + function(phy, ...) { + newick2phylog(write.tree(phy, multi.line = FALSE),...) + } > > plot.phylo(as(p2,"phylo")) Warning message: In asMethod(object) : losing data while coercing phylo4d to phylo > > proc.time() user system elapsed 2.07 0.26 2.36