ggtree
ggtree copied to clipboard
errors in using viewClade
Hi Guangchuang, When i run the followed code, i can not obtain the clade subtree. Do you know the reason? Thanks for your help!
library(ggtree) library(tidytree) nwk <- system.file("extdata", "sample.nwk", package="treeio") tree <- read.tree(nwk) p <- ggtree(tree) + geom_tiplab() viewClade(p, MRCA(p, tip=c("I", "L")))
The error information is as followed: Error in UseMethod("MRCA") : no applicable method for 'MRCA' applied to an object of class "c('ggtree', 'gg', 'ggplot')" In addition: Warning messages: 1: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 2: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 3: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation
You need to remove the tip= part. Try replacing the line beginning with viewClade with:
viewClade(p, MRCA(p, "I", "L"))
@brj1 Thanks for your help! When i run the code, it still has errors. Do you know the reason? Error in MRCA(p, "I", "L") : unused argument ("L") In addition: Warning messages: 1: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 2: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 3: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation
if you really follow the guideline, you will figure it out.
- [ ] make sure your are using the latest release version
@GuangchuangYu it might be best to change:
* [ ] make sure your are using the latest release version
to
* [ ] make sure your are using the latest GitHub version
The release (BioConductor) version is often very out of date, though I admit that this has recently changed.