YuLab-SMU / ggtree

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

flip tree function #542

Closed antoine4ucsd closed 1 year ago

antoine4ucsd commented 1 year ago

hello thank you for the amazing package. definitely the best! I am struggling with the flip function I just want to reroot upside down my ggtree but I get this error

set.seed(123)
x <- rtree(15)
p<- ggtree(x) + geom_tiplab() +
        geom_nodelab(aes(subset=!isTip, label=node), hjust = -.1, color = "red")

flip(p, 23, 24) 

error:

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘flip’ for signature ‘"ggtree"’

is there another function?? thank you

GuangchuangYu commented 1 year ago

please upgrade to latest version.

antoine4ucsd commented 1 year ago

thank you