Open GuangchuangYu opened 1 year ago
Hello, I have tried to reconstruct the course on http://yulab-smu.top/treedata-book/chapter6.html#collapsing-and-expanding-clade, and add a parameter height = NULL to ggtree::collapse() to see how it work.
This is the problem.
p2 <- p + geom_tiplab() node <- 17 collapse(p2, node, 'max', height = 1) %>% expand(node)
Then, it return "Ignoring unknown parameters: height
"
I have updata my ggtree to v3.4.4, just now.
另外我尝试了结合使用scaleClade() 和 collapse(), https://github.com/YuLab-SMU/ggtree/issues/409#issuecomment-1069215382 相较于说明文档做出了更好的等比缩小,实现了宽度统一。 两个三角因为缩放方式的原因仍存在细微区别,这个区别会因为原本形状的差异而更突出。
Then, it return "Ignoring unknown parameters: height"
so me the code.
library(ggtree) nwk <- system.file("extdata", "sample.nwk", package="treeio") tree <- read.tree(nwk) p <- ggtree(tree) + geom_tiplab() node <- 17 collapse(p, node, 'max', height = 1) %>% expand(node)
height
you need to modify the collapse()
function to introduce this new parameter.
This is a feature request posted on https://github.com/YuLab-SMU/ggtree/issues/409.
I have posted the requirement of this parameter, see https://github.com/YuLab-SMU/ggtree/issues/409#issuecomment-944034311.
In the same thread, there is a prototype by incorporating
scaleClade()
withcollapse()
, see https://github.com/YuLab-SMU/ggtree/issues/409#issuecomment-1069215382.