... | ... |
@@ -16,7 +16,11 @@ geom_range <- function(range="height_0.95_HPD", ...) { |
16 | 16 |
|
17 | 17 |
default_aes <- aes_(x=~x, y=~y, xend=~x, yend=~y) |
18 | 18 |
|
19 |
- mapping <- modifyList(default_aes, aes_string(branch.length="branch.length", label=range)) |
|
19 |
+ if (grepl("^height", range)) { |
|
20 |
+ mapping <- modifyList(default_aes, aes_string(branch.length="height", label=range)) |
|
21 |
+ } else { |
|
22 |
+ mapping <- modifyList(default_aes, aes_string(branch.length="branch.length", label=range)) |
|
23 |
+ } |
|
20 | 24 |
|
21 | 25 |
layer( |
22 | 26 |
stat = StatRange, |
... | ... |
@@ -26,7 +30,8 @@ geom_range <- function(range="height_0.95_HPD", ...) { |
26 | 30 |
position = position, |
27 | 31 |
show.legend=show.legend, |
28 | 32 |
inherit.aes = inherit.aes, |
29 |
- params = list(na.rm = na.rm, ...), |
|
33 |
+ params = list(na.rm = na.rm, |
|
34 |
+ ...), |
|
30 | 35 |
check.aes = FALSE |
31 | 36 |
) |
32 | 37 |
|
... | ... |
@@ -42,6 +47,7 @@ StatRange <- ggproto("StatRange", Stat, |
42 | 47 |
rr2 <- strsplit(rr, split=',') %>% do.call('rbind', .) |
43 | 48 |
rr2 <- matrix(as.numeric(rr2), ncol=2, byrow=FALSE) |
44 | 49 |
rr2 <- rr2 + df$x - df$branch |
50 |
+ |
|
45 | 51 |
data.frame(x = rr2[,1], |
46 | 52 |
xend = rr2[,2], |
47 | 53 |
y = df$y, |
... | ... |
@@ -4,7 +4,7 @@ ggtree: an R package for visualization and annotation of phylogenetic trees with |
4 | 4 |
|
5 | 5 |
[](https://bioconductor.org/packages/ggtree) [](https://github.com/GuangchuangYu/ggtree) [](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#since) [](https://bioconductor.org/packages/stats/bioc/ggtree) [](https://bioconductor.org/packages/stats/bioc/ggtree) <img src="logo.png" align="right" /> |
6 | 6 |
|
7 |
-[](http://www.repostatus.org/#active) [](https://codecov.io/gh/GuangchuangYu/ggtree) [](https://github.com/GuangchuangYu/ggtree/commits/master) [](https://github.com/GuangchuangYu/ggtree/network) [](https://github.com/GuangchuangYu/ggtree/stargazers) [](https://awesome-r.com/#awesome-r-graphic-displays) |
|
7 |
+[](http://www.repostatus.org/#active) [](https://codecov.io/gh/GuangchuangYu/ggtree) [](https://github.com/GuangchuangYu/ggtree/commits/master) [](https://github.com/GuangchuangYu/ggtree/network) [](https://github.com/GuangchuangYu/ggtree/stargazers) [](https://awesome-r.com/#awesome-r-graphic-displays) |
|
8 | 8 |
|
9 | 9 |
[](https://www.bioconductor.org/packages/devel/bioc/html/ggtree.html#archives) [](https://bioconductor.org/checkResults/devel/bioc-LATEST/ggtree/) [](https://travis-ci.org/GuangchuangYu/ggtree) [](https://ci.appveyor.com/project/GuangchuangYu/ggtree) [](http://bioconda.github.io/recipes/bioconductor-ggtree/README.html) |
10 | 10 |
|