Browse code

update the print of refs

xiangpin authored on 03/03/2022 03:22:04
Showing1 changed files

  • R/zzz.R index 62bca90d..416b98f4 100644
... ...
@@ -1,15 +1,9 @@
1 1
 ##' @importFrom utils packageDescription
2 2
 ##' @importFrom pillar style_subtle
3 3
 .onAttach <- function(libname, pkgname) {
4
-    pkgVersion <- packageDescription(pkgname, fields="Version")
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"))
4
+    pkgVersion <- packageDescription(pkgname, fields = "Version")
5
+    ref <- random_ref(pkgname = pkgname, pkgVersion = pkgVersion, random_n = 2)
6
+    if (!is.null(ref)) packageStartupMessage(ref)
13 7
 }
14 8
 
15 9
 random_ref <- getFromNamespace("random_ref", 'tidytree')