Comments (4)
the priority of %>%
is higher than +
, so you should use:
(ggtree(tree) + geom_text(aes(label=node))) %>% collapse(node=21)
from ggtree.
It looks like the collapse function is working backward and erasing all the parental branches instead of the daughters.
require(ape)
set.seed(123)
tree <- rtree(10)
tree <- ggtree(tree)
tree %>% ggtree::collapse(node=4)
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 18.3
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tidytree_0.2.4 treeio_1.9.1 phytools_0.6-60 maps_3.3.0 ape_5.3 ggridges_0.5.1 cowplot_0.9.4
[8] forcats_0.4.0 stringr_1.4.0 dplyr_0.8.1 purrr_0.3.2 readr_1.3.1 tidyr_0.8.3 tibble_2.1.1
[15] tidyverse_1.2.1 ggplot2_3.1.1 ggtree_1.17.1
from ggtree.
> tree %>% ggtree::collapse(node=4)
Warning message:
In collapse.ggtree(., node = 4) : input node is a tip...
now it will throw warning if input node is a tip and return the input tree.
from ggtree.
still getting same error on data I know for a fact is not a tip
from ggtree.
Related Issues (20)
- colour of scale_alpha_continuous
- Collapsing clade in circular layout gives curved min/max/mixed triangles
- 'cophyloplot' equivalent function HOT 2
- ggtree not able to produce emojis in color
- Request to add roundrect.r option to layout.params HOT 1
- Issue with linear tree with only one parent and one
- layout_dendrogram and theme_tree2 are incompatiable HOT 1
- Error with geom_inset of nodepies onto circular/radial/fan trees
- Unwanted white lines between tiles in gheatmap layout circular/fan
- rect_to_poly issue HOT 9
- Tree tips not colored according to specified colors HOT 2
- geom_cladelab doesn't facet
- facet_plot will not plot correctly align to branch in ggtree
- geom_hilight rectangle unreasonably long
- geom_highlight compresses the tree slightly
- Basic functionality missing from ggtree
- Problems with Collapse function
- Same name on one tree (2 copies), add links to another tree problem
- 无法正常绘制layout = "equal-angle"的tree
- theme_tree2 scale bar width
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggtree.