YuLab-SMU / ggtree

:christmas_tree:Visualization and annotation of phylogenetic trees
https://yulab-smu.top/treedata-book/
821 stars 172 forks source link

Error running drop.tip example #581

Closed pedur1 closed 11 months ago

pedur1 commented 11 months ago

There appears to be an error with the drop.tip function from the treeio package

When the following example from drop.tip's Help entry is run

nhxfile <- system.file("extdata/NHX", "ADH.nhx", package="treeio")
nhx <- read.nhx(nhxfile)
drop.tip(nhx, c("ADH2", "ADH1"))

The following error occurs: Error in UseMethod("drop.tip"): no applicable method for 'drop.tip' applied to an object of class "treedata"

Note that I made sure that the the ape package was loaded, as I am aware that treeio::drop.tip is a wrapper for ape::drop.tip

I also replicated the error when running the code chunk from ggtree book (Section 2.5.1)

pedur1 commented 11 months ago

I loaded the most recent version of the treeio package and specified this with drop tip - and the code ran as expected