Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message to encourage citing the package #127

Open
judith-bourque opened this issue Jul 1, 2023 · 0 comments
Open

Add message to encourage citing the package #127

judith-bourque opened this issue Jul 1, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@judith-bourque
Copy link
Member

judith-bourque commented Jul 1, 2023

Suggestion

I've received the following suggestion by e-mail:

Recently, I have been thinking about how to increase citations to R packages. I believe one of the reasons users don't cite software is that citations to software aren't the norm in academia. Another is that users forget. Taking inspiration from Marek Hlavac, whose stargazer package has more than 1,000 citations, I believe a short .onAttach message cuing the citation can help increase citations.
Here's the code in stargazer that produces the StartupMessage:

https://github.com/cran/stargazer/blob/master/R/stargazer-internal.R

We can also rewrite the code using the citation function in R as follows:

packageStartupMessage("\nPlease cite as:\n")
citationInfo <- citation("stargazer")
 
packageStartupMessage(paste(citationInfo$title))

A note thanking users may make the message even more effective:

.onAttach <- function(libname, pkgname) {
  package_citation <- "Author, X. (Year). MyPackage: A powerful R package for XYZ. R Foundation for Statistical Computing. Version X.X. URL: https://example.com/mypackage"
  message("Thank you for using MyPackage!")
  message("To acknowledge our work, please cite the package:")
  message(package_citation)
}

See also

@judith-bourque judith-bourque added the enhancement New feature or request label Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant