Title: | Software Bibliographies for R Projects |
---|---|
Description: | Detect libraries used in a project and automatically create software bibliographies in 'PDF', 'Word', 'Rmarkdown', and 'BibTeX' formats. |
Authors: | Vincent Arel-Bundock [aut, cre, cph] |
Maintainer: | Vincent Arel-Bundock <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.2 |
Built: | 2024-11-15 14:20:15 UTC |
Source: | https://github.com/vincentarelbundock/softbib |
This function detects all the R packages used in a project folder and automatically creates software bibliographies in PDF, Word, Rmarkdown and BibTeX formats.
softbib( output = c("softbib.pdf", "softbib.docx", "softbib.bib", "softbib.Rmd"), output_dir = getwd(), include = NULL, exclude = NULL, style = NULL )
softbib( output = c("softbib.pdf", "softbib.docx", "softbib.bib", "softbib.Rmd"), output_dir = getwd(), include = NULL, exclude = NULL, style = NULL )
output |
vector of file paths or |
output_dir |
path of the directory where files should be saved. |
include |
|
exclude |
character vector of package names to exclude from the bibliography. |
style |
Path to a Citation Style Language file (with |
Writes bibliography to file and returns a character vector of citation keys.
if (interactive()) { # Save current path oldpath <- getwd() # Navigate to a project folder, crawl the working directory to get a list of `R` # packages, and create bibliographies library(softbib) setwd("~/path/to/my/R/project/") softbib() # Exclude some packages from the bibliography softbib(exclude = c("base", "dplyr")) # Specify the list of packages to include manually softbib(include = c("countrycode", "modelsummary", "marginaleffects")) # Download a Citation Style Language file from the Zotero archive and print a # bibliography in the style of the American Political Science Review download.file( "https://www.zotero.org/styles/american-political-science-review", destfile = "apsr.csl") softbib(style = "apsr.csl") # Return to old path setwd(oldpath) } # end if(interactive()){}
if (interactive()) { # Save current path oldpath <- getwd() # Navigate to a project folder, crawl the working directory to get a list of `R` # packages, and create bibliographies library(softbib) setwd("~/path/to/my/R/project/") softbib() # Exclude some packages from the bibliography softbib(exclude = c("base", "dplyr")) # Specify the list of packages to include manually softbib(include = c("countrycode", "modelsummary", "marginaleffects")) # Download a Citation Style Language file from the Zotero archive and print a # bibliography in the style of the American Political Science Review download.file( "https://www.zotero.org/styles/american-political-science-review", destfile = "apsr.csl") softbib(style = "apsr.csl") # Return to old path setwd(oldpath) } # end if(interactive()){}