Closed lerouzic closed 1 month ago
Hello @lerouzic,
Do you have an example without loading ggtree? Here's what I got:
R> library(ape)
R> x <- "(((Strix_aluco:4.2,Asio_otus:4.2):3.1,Athene_noctua:7.3):6.3,Tyto_alba:5);"
R> tree.owls <- read.tree(text= x)
R> c.tree.owls <- chronos(tree.owls, lambda=1, quiet=TRUE)
R> class(c.tree.owls)
[1] "chronos" "phylo"
R> class(as.phylo(c.tree.owls))
[1] "chronos" "phylo"
which is as expected. Maybe the issue comes after loading ggtree. Also the current version of ape on CRAN is 5.8.
Cheers,
Emmanuel
Also the current version of ape on CRAN is 5.8.
I could reproduce the bug without ggtree, but the problem has indeed vanished after an update of ape from 5.7 to 5.8.
Sorry for not noticing I was not running the last version of ape! I think the issue can be safely closed.
Hello,
It seems that as.phylo() does not fall back to as.phylo.default for multiple class objects (below an example with chronos, ggtree calls as.phylo() on an object of class c("chronos","phylo"), and as.phylo crashes without calling as.phylo.default).
Note that the ggtree example was for the "real life" case, but this happens when simply calling as.phylo() in any context.
I suspect a problem with the S3 method export, but I have not checked.
R version 4.4.0 (2024-04-24), ape_5.7-1