Skip to content

Commit dcf2de2

Browse files
Merge pull request #139 from bennettoxford/milanwiedemann/add-citation-startup-msg
Add citation startup message
2 parents 63203ee + 52f6355 commit dcf2de2

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ importFrom(stringr,str_replace_all)
5656
importFrom(tibble,as_tibble)
5757
importFrom(tibble,tibble)
5858
importFrom(tidyr,complete)
59+
importFrom(utils,citation)

R/zzz.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
options(rmarkdown.html_vignette.check_title = FALSE)
44
}
55

6+
#' @importFrom utils citation
7+
.onAttach <- function(libname, pkgname) {
8+
cit <- utils::citation(pkgname)
9+
doi_url <- paste0("https://doi.org/", cit$doi)
10+
packageStartupMessage("To cite ", pkgname, " use: ", doi_url)
11+
}
12+
613
utils::globalVariables(c(
714
"annual_proportion",
815
"start_date",

0 commit comments

Comments
 (0)