Comments (2)
Looks like the problem is there:
Lines 1106 to 1109 in a9717ae
This returns parents
as a list, not an integer vector as expected:
> head(parents)
[[1]]
[1] 4
[[2]]
[1] 5
[[3]]
[1] 6
[[4]]
[1] 7
[[5]]
[1] 8
[[6]]
[1] 9
> table(sapply(parents, length))
0 1
1 45598
> which.min(sapply(parents, length))
[1] 45519
> parents[45519]
[[1]]
integer(0)
> e[45519,]
parent child length isTip x0 x1 y0 y1
86210 67061 84808 0.3695876 FALSE 0 0.3695876 65882.59 65882.59
> which(obj$edges$child == 67061)
integer(0)
> Ntip(phy)
[1] 67060
The node in question is the root.
from ggfree.
Potential fix:
@@ -1105,6 +1107,8 @@ draw.clade <- function(obj, tips, col='red', is.mono=TRUE, max.tips=100, ...) {
if (obj$layout == 'rectangular') {
parents <- sapply(e$parent, function(p) which(obj$edges$child==p))
+ # exclude root node
+ parents <- unlist(parents)
segments(x0=e$x0, y0=e$y0, y1=obj$edges$y0[parents], col=col, ...)
}
else if (obj$layout == 'radial') {
But there are extra lines being drawn:
from ggfree.
Related Issues (20)
- as.phyloData fails for an annotated tree that was just unrooted
- Add matrix rotation for tree layouts
- Incorrect branch lengths from unrooted (equal angle) layout HOT 1
- phangorn midpoint breaks tree.layout HOT 1
- Contribute package to CRAN
- Passing `log='y'` to slopegraph() throws warnings
- slopegraph changes par(mar), should revert back to user's settings
- subtrees() is making as.phyloLayout slow HOT 1
- stackplot: Incorporate baselines from Byron and Wattenberg HOT 1
- slopegraph could be generalized to parallel coordinates
- stackplot: 'w' type is wrong HOT 2
- Error while downloading ggfree package HOT 2
- ridgeplot fails if user passes vector instead of list
- ringplot is squished if plot area is not square
- tree: draw.clade doesn't work for rectangular layout HOT 3
- Decorating a bird phylogeny with a numerical variable HOT 13
- ridgeplot: can't set step to zero HOT 1
- tree: color labels don't work for circular layout HOT 4
- tree: rooting the tree might break count.tips() HOT 1
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 ggfree.