YuLab-SMU / treeio

:seedling: Base Classes and Functions for Phylogenetic Tree Input and Output
https://yulab-smu.top/treedata-book/
96 stars 26 forks source link

Error using as.treedata() for pml object #127

Open gdunshea opened 2 months ago

gdunshea commented 2 months ago

Hello,

I have made a pml tree similar to section 1.3.3 in your vignette. However, when I get to

pmltree <- as.treedata(fit)

I get the following error:

Error in UseMethod("as.treedata") : no applicable method for 'as.treedata' applied to an object of class "pml"

I am at a loss here and wonder if you could help.

Thanks, Glenn

brj1 commented 2 months ago

Try loading the tidytree package first. as.treedata() lives there now.

library(tidytree)