update citation
... | ... |
@@ -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,8 @@ |
1 | 1 |
##' @importFrom utils packageDescription |
2 | 2 |
.onAttach <- function(libname, pkgname) { |
3 |
- 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)) |
|
3 |
+ pkgVersion <- packageDescription(pkgname, fields = "Version") |
|
4 |
+ ref <- random_ref(pkgname = pkgname, pkgVersion = pkgVersion, random_n = 2) |
|
5 |
+ if (!is.null(ref)) packageStartupMessage(ref) |
|
12 | 6 |
} |
13 | 7 |
|
14 |
- |
|
8 |
+random_ref <- getFromNamespace("random_ref", 'tidytree') |