Skip to content

This R-function creates a .bib-file that includes the citations from all the packages that you have used in a project.

License

Notifications You must be signed in to change notification settings

Sebaristoteles/citeR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

citeR

This R-function creates a .bib-file that includes the citations from all the packages that you have used in a project. The input can be a file or folder. The function will use all R-files and Rmd-files and extract the

You must specify

  • the input

You can specify

  • the output file location and name
  • a vector of packagaes to exclude
citeR <- function(input, output, exclude)

Code to install packages to your system

install_package_if_missing <- function(pkg) {
  if (! pkg %in% installed.packages()[, "Package"]) install.packages(pkg)
}
install_package_if_missing("tidyverse")
install_package_if_missing("purr")

How to install a package/R-file from GitHub

First, you need to install the devtools package. You can do this from CRAN. Invoke R and then type

install.packages("devtools")

Load the devtools package.

library(devtools)

Usually you just use install_github("author/package") but it's not yet a package. Therefore, just do as follows

  devtools::source_url(
    "https://raw.githubusercontent.com/sebaristoteles/citeR/main/cite.R"
  )

About

This R-function creates a .bib-file that includes the citations from all the packages that you have used in a project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages