Skip to content

Commit 4450d39

Browse files
committed
add citation
1 parent e972bcb commit 4450d39

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Imports:
1818
magrittr,
1919
methods,
2020
utils,
21-
yulab.utils (>= 0.1.9)
21+
yulab.utils (>= 0.1.9),
22+
pillar
2223
Suggests:
2324
ggtree
2425
URL: https://github.com/YuLab-SMU/aplot, https://yulab-smu.top/aplot/

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,6 @@ importFrom(patchwork,patchworkGrob)
6666
importFrom(patchwork,plot_annotation)
6767
importFrom(patchwork,plot_layout)
6868
importFrom(patchwork,plot_spacer)
69+
importFrom(pillar,style_subtle)
6970
importFrom(utils,modifyList)
71+
importFrom(utils,packageDescription)

R/zzz.R

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#' @importFrom utils packageDescription
2+
#' @importFrom pillar style_subtle
3+
.onAttach <- function(libname, pkgname) {
4+
pkgVersion <- packageDescription(pkgname, fields="Version")
5+
msg <- paste0(pkgname, " v", pkgVersion, " ",
6+
"For help: https://github.com/YuLab-SMU/aplot/issues", "\n\n")
7+
8+
citation <- paste0("If you use ", pkgname,
9+
" in published research, please cite the paper:\n\n",
10+
aplot_citations())
11+
12+
packageStartupMessage(paste0(strwrap(pillar::style_subtle(paste0(msg, citation, suppressmsg(pkgname)))), collapse="\n"))
13+
}
14+
15+
aplot_citations <- function(){
16+
paste("Shuangbin Xu, Qianwen Wang, Shaodi Wen, Junrui Li, Nan He, Ming Li, Thomas Hackl, Rui Wang,
17+
Dongqiang Zeng, Shixiang Wang, Shensuo Li, Chunhui Gao, Lang Zhou, Shaoguo Tao, Zijing Xie,
18+
Lin Deng, and Guangchuang Yu.",
19+
"aplot: Simplifying the creation of complex graphs to visualize associations across diverse data types.",
20+
"The Innovation. 2025, 6(9):100958. doi: 10.1016/j.xinn.2025.100958\n\n",
21+
"Export the citation to BibTex by citation('aplot')\n\n"
22+
)
23+
24+
}
25+
26+
suppressmsg <- function(pkgname){
27+
paste0("This message can be suppressed by:\n",
28+
"suppressPackageStartupMessages(library(", pkgname ,"))"
29+
)
30+
}

0 commit comments

Comments
 (0)