Browse code

update citation

xiangpin authored on 01/03/2022 07:37:15
Showing3 changed files

... ...
@@ -34,7 +34,8 @@ Imports:
34 34
     tidytree (>= 0.2.6),
35 35
     treeio (>= 1.8.0),
36 36
     utils,
37
-    scales
37
+    scales,
38
+    pillar
38 39
 Suggests:
39 40
     emojifont,
40 41
     ggimage,
... ...
@@ -262,6 +262,7 @@ importFrom(methods,is)
262 262
 importFrom(methods,missingArg)
263 263
 importFrom(methods,setGeneric)
264 264
 importFrom(methods,setOldClass)
265
+importFrom(pillar,style_subtle)
265 266
 importFrom(rlang,.data)
266 267
 importFrom(rlang,abort)
267 268
 importFrom(rlang,as_name)
... ...
@@ -1,14 +1,15 @@
1 1
 ##' @importFrom utils packageDescription
2
+##' @importFrom pillar style_subtle
2 3
 .onAttach <- function(libname, pkgname) {
3 4
     pkgVersion <- packageDescription(pkgname, fields="Version")
4
-    msg <- paste0(pkgname, " v", pkgVersion, "  ",
5
-                  "For help: https://yulab-smu.top/treedata-book/", "\n\n")
6
-
7
-    citation <- paste0("If you use ", pkgname,
8
-                       " in published research, please cite the most appropriate paper(s):\n\n",
9
-                       ggtree_citations(), "\n")
10
-
11
-    packageStartupMessage(paste0(msg, citation))
5
+    msg <- style_subtle(paste0(pkgname, " v", pkgVersion, "  ",
6
+                  "For help: https://yulab-smu.top/treedata-book/", "\n\n"))
7
+
8
+    #citation <- paste0("If you use ", pkgname,
9
+    #                   " in published research, please cite the most appropriate paper(s):\n\n",
10
+    #                   ggtree_citations(), "\n")
11
+    citation <- random_ref()
12
+    packageStartupMessage(paste(strwrap(paste0(msg, citation)), collapse = "\n"))
12 13
 }
13 14
 
14
-
15
+random_ref <- getFromNamespace("random_ref", 'tidytree')