R2zotero aims to facilitate citation of R packages by importing citations from an R package's 'CITATION' file directly to a local Zotero library using the Zotero Web API.
You can install the development version of r2zotero from GitHub with:
# install.packages("pak")
pak::pak("ethanbass/r2zotero")or from r-universe:
install.packages("r2zotero", repos="https://ethanbass.r-universe.dev/")To send a citation to Zotero:
library(r2zotero)
r2zotero("lattice")To cite several packages at once, pass a vector of names. To skip citations already in your Zotero library, add skip_duplicates = TRUE. This needs Zotero's local API, which you can turn on under Settings > Advanced > Allow other applications on this computer to communicate with Zotero.
# every attached package
r2zotero(names(sessionInfo()$otherPkgs))
# the packages a project's code loads
r2zotero(renv::dependencies()$Package)
# every package in an renv lockfile, including indirect dependencies
r2zotero(names(jsonlite::read_json("renv.lock")$Packages))The card catalog in the logo is an engraving from James Duff Brown's Manual of Library Classification and Shelf Arrangement (1898), via Wikimedia Commons.
