Citing R packages
I am having trouble citing R packages in the Nature formatting style. Whatever item type I use (I've tried Computer Program, Journal Article, Report, Book), they are not displayed as suggested in R. The URL and the version number are missing.
Which item type do you suggest, so that both URL and version number are cited?
According to R, the output should be like this: (I assume this is APA style)
Wickham, H. and Henry, L. (2018). tidyr: Easily Tidy Data with 'spread()' and 'gather()' Functions. R package version 0.8.1. https://CRAN.R-project.org/package=tidyr
So adapted for Nature, it should be:
Wickham, H. and Henry, L. tidyr: Easily Tidy Data with 'spread()' and 'gather()' Functions. R package version 0.8.1. https://CRAN.R-project.org/package=tidyr (2018)
Which item type do you suggest, so that both URL and version number are cited?
According to R, the output should be like this: (I assume this is APA style)
Wickham, H. and Henry, L. (2018). tidyr: Easily Tidy Data with 'spread()' and 'gather()' Functions. R package version 0.8.1. https://CRAN.R-project.org/package=tidyr
So adapted for Nature, it should be:
Wickham, H. and Henry, L. tidyr: Easily Tidy Data with 'spread()' and 'gather()' Functions. R package version 0.8.1. https://CRAN.R-project.org/package=tidyr (2018)
Thanks for your quick answers!
I checked another post from 2013 looking for a way to do this.
Before I stardted using Zotero, I wrote references manually and now that I do use it, I'm affraid of messing things up if I do that.
My idea right now is to split my Bibliography between R packages and scientific articles.
Would you advise I wait until the very end and unlink citations before mixing R packages with scientifc articles and having references strictly follow journal guidelines ?
I might need to move things again even if I think adding R package references will be the last thing I do, so I am reluctant to think about that option.
Thank you very much. I am currently using the Springer - Basic (author-date, no "et al.") style since I noticed that the current version I have of Wiley's "Plant pathology" style does not include "usual articles" DOIs (for me at least), and someone pointed out to me in another discussion I had mixed up the two. I just checked and it seems that Springer - Basic (author-date, no "et al.") does not yet (once again for me at least) include DOIs for links I get from CRAN.
Yes, here is what I have recieved from using "citation("lme4")" in R:
Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48. doi:10.18637/jss.v067.i01.
And here is what the Springer - Basic (author-date, no "et al.") style gives me after i click the "save to zotero" button from CRAN for lme4:
Bates D, Maechler M, Bolker [aut B, cre, Walker S, Christensen RHB, Singmann H, Dai B, Scheipl F, Grothendieck G, Green P, Fox J, Bauer A, simulate.formula) PNK (shared copyright on (2021) lme4: Linear Mixed-Effects Models using “Eigen” and S4.
The first argument should be a character vector of package names, and the second argument is the path to the .bib file. In the above example, .packages() returns the names of all packages loaded in the current R session. This makes sure all packages being used will have their citation entries written to the .bib file. When any of these packages are updated (e.g., the author, title, year, or version of a package is changed), write_bib() can automatically update the .bib file.
See https://bookdown.org/yihui/rmarkdown-cookbook/write-bib.html for more information
Most packages I want to cite are referenced as type "Manual," but that's not one of Zotero's item type options.
Zotero imported them as type "book," and the package version is imported in a nested note. That note won't be displayed in any formatting style.
So I tried by changing the type to "Software" and the "note" tag for a "version" tag in the .bib file, but that still doesn't provide the recommended citation.
Any other ideas on how to change the bib file to get the citation they recommend?
Maybe Zotero devs can create a "Manual" item type that supports note tags and show them in most citation styles?
Also, while .bib is widely used, it's at the same time quite limited and poorly standardized, so if at all possible I'd avoid taking a .bib file as a starting point. Why not start in Zotero?
I'm trying to add R package citations to Zotero in tandem (instead of one by one).
Every R package provides the information needed to be cited (in the DESCRIPTION file), and some R functions compile that information and create a .bib file.
That's why a .bib file is my starting point. Unfortunately, .bib is indeed very limited and poorly standardized, especially when created from the R packages description file.
I'm aware that correct citation depends on citation style and that I don't need to recreate the recommended citation. However, I agree with Hannah that URL and version are essential and should be reported in most citation styles.
So, my question is simply what the best item type for an R package citation would be to show both URL and version most of the time?
You can check the CITATION information in the package to see if the author would prefer a journal article be cited (in that case, I strongly suggest citing _both_ the package itself and the article), but I would rely on the metadata from CRAN for the package, as this will be more up to date and accurate