I am building my R package using Roxygen2
and devtools
, and I would like to add some citation information in my R
codes (i.e. I hope to write in a .R
file from which the citations can be auto-generated). The ultimate goal is to display, once I run the command citation(MyPkgName)
, the citations of the R package as well as the citation (preferrably with BibTeX entry) of the paper I submit. Is there a way to do that using devtools
? Thanks!
citation() To cite R in publications use: R Core Team (2013). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/.
Absolutely! Citations are free, and they are a blessing to the creators of those packages. Unless you're held to a strict page limit, there's no reason not to have a "methods" section in which you list all of the packages you used. It can be a single sentence.
The CITATION file of an R package should be placed in the inst subdirectory of the package source. The file is an R source file and may contain arbitrary R commands including conditionals and computations. Function readCitationFile() is used by citation() to extract the information in CITATION files.
All we have to do is add a comma after R Development Core Team in the name field. This tells EndNote that R Core Development Team is a complete last name of an author that has no first name. Hence, EndNote uses what it has (a last name with no first name) in generating its citations.
CITATION
template can be created automatically with
usethis::use_citation()
Once the file is created, you only need to fill in the gaps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With