Browse code

geom_tiplab(parse="emoji") compatible with upcoming ggplot2 v=2.3.0

guangchuang yu authored on 23/05/2018 03:06:13
Showing6 changed files

... ...
@@ -2,7 +2,7 @@ Package: ggtree
2 2
 Type: Package
3 3
 Title: an R package for visualization and annotation of phylogenetic trees with
4 4
     their covariates and other associated data
5
-Version: 1.13.0.002
5
+Version: 1.13.0.003
6 6
 Authors@R: c(
7 7
 	   person("Guangchuang", "Yu",     email = "guangchuangyu@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0002-6485-8781")),
8 8
 	   person("Tommy Tsan-Yuk", "Lam", email = "tylam.tommy@gmail.com",   role = c("aut", "ths")),
... ...
@@ -18,14 +18,14 @@ Depends:
18 18
 Imports:
19 19
     ape,
20 20
     dplyr,
21
-    ggplot2 (>= 2.2.0),
21
+    ggplot2 (>= 2.2.1.9000),
22 22
     grDevices,
23 23
     grid,
24 24
     magrittr,
25 25
     methods,
26 26
     purrr,
27 27
     rlang,
28
-    rvcheck,
28
+    rvcheck (>= 0.1.0),
29 29
     scales,
30 30
     tibble,
31 31
     tidyr,
... ...
@@ -56,7 +56,7 @@ gitmaintain:
56 56
 	git fsck --full
57 57
 
58 58
 release:
59
-	git checkout RELEASE_3_6;\
59
+	git checkout RELEASE_3_7;\
60 60
 	git fetch --all
61 61
 
62 62
 update:
... ...
@@ -211,6 +211,7 @@ importFrom(methods,missingArg)
211 211
 importFrom(methods,setGeneric)
212 212
 importFrom(methods,setOldClass)
213 213
 importFrom(rlang,.data)
214
+importFrom(rvcheck,get_aes_var)
214 215
 importFrom(rvcheck,get_fun_from_pkg)
215 216
 importFrom(scales,alpha)
216 217
 importFrom(tibble,data_frame)
... ...
@@ -1,5 +1,6 @@
1
-# ggtree 1.13.0.002
1
+# ggtree 1.13.0.003
2 2
 
3
++ compatible with ggplot2 2.2.1.9000 for `geom_tiplab(parse="emoji")` (2018-05-23, Wed)
3 4
 + typo on vignettes (2018-05-08, Tue)
4 5
   - <https://github.com/GuangchuangYu/ggtree/pull/178>, thanks [@abichat](https://github.com/abichat)
5 6
 + compatible with ggplot2 2.2.1.9000 (2018-05-02, Wed)
... ...
@@ -20,6 +20,7 @@
20 20
 ##' @importFrom ggplot2 layer
21 21
 ##' @importFrom ggplot2 position_nudge
22 22
 ##' @importFrom ggplot2 aes_string
23
+##' @importFrom rvcheck get_aes_var
23 24
 ##' @export
24 25
 ##' @seealso
25 26
 ##' \link[ggplot2]{geom_text}
... ...
@@ -53,11 +54,13 @@ geom_text2 <- function(mapping = NULL, data = NULL,
53 54
     }
54 55
 
55 56
     if (parse == "emoji") {
56
-        label_aes <- aes_string(label=paste0("suppressMessages(emoji(", as.list(mapping)$label,"))"))
57
-        mapping <- modifyList(mapping, label_aes)
58 57
         emoji <- get_fun_from_pkg("emojifont", "emoji")
59 58
         parse <- FALSE
60 59
         family <- "EmojiOne"
60
+        ## label_aes <- aes_string(label=paste0("suppressMessages(emoji(", as.list(mapping)$label,"))"))
61
+        label_aes <- aes_string(label=paste0("suppressMessages(emoji(", get_aes_var(mapping, "label"), "))"))
62
+        ## mapping <- modifyList(mapping, aes(label=emoji(!!mapping$label))) ## ggplot2 >= 2.3.0
63
+        mapping <- modifyList(mapping, label_aes)
61 64
     }
62 65
 
63 66
     layer(
... ...
@@ -192,12 +192,8 @@ knitr::kable(geoms, caption = "Geom layers defined in ggtree.", booktabs = T)
192 192
 ```
193 193
 
194 194
 `r Biocpkg('ggtree')` supports creating phylomoji using Emoji fonts, please
195
-refer to `r CRANpkg("emojifont")` package vignette for details. The vignette can
196
-be opened via the following command:
197
-
198
-```r
199
-vignette("phylomoji", package="emojifont")
200
-```
195
+refer to the
196
+[Phylomoji](https://guangchuangyu.github.io/software/ggtree/vignettes/phylomoji.html) vignette.
201 197
 
202 198
 
203 199
 `r Biocpkg('ggtree')` integrates [phylopic](http://phylopic.org/) database and silhouette images of organisms can
... ...
@@ -224,7 +220,7 @@ the [Tree Annotation](treeAnnotation.html) vignette.
224 220
 + [Tree Visualization](treeVisualization.html)
225 221
 + [Tree Manipulation](treeManipulation.html)
226 222
 + [Tree Annotation](treeAnnotation.html)
227
-+ [Phylomoji](https://cran.r-project.org/web/packages/emojifont/vignettes/phylomoji.html)
223
++ [Phylomoji](https://guangchuangyu.github.io/software/ggtree/vignettes/phylomoji.html)
228 224
 + [Annotating phylogenetic tree with images](https://guangchuangyu.github.io/software/ggtree/vignettes/ggtree-ggimage.html)
229 225
 + [Annotate a phylogenetic tree with insets](https://guangchuangyu.github.io/software/ggtree/vignettes/ggtree-inset.html)
230 226