Skip to content

Instantly share code, notes, and snippets.

@muschellij2
Created October 12, 2017 17:55
Show Gist options
  • Save muschellij2/838e33644e6714ada62ed28289123541 to your computer and use it in GitHub Desktop.
Save muschellij2/838e33644e6714ada62ed28289123541 to your computer and use it in GitHub Desktop.
Making a CITATION file for R package from bibtex entry
library(bibtex)
x = "@article{shou2013quantifying,
title={Quantifying the reliability of image replication studies: the image intraclass correlation coefficient (I2C2)},
author={Shou, H and Eloyan, A and Lee, S and Zipunnikov, V and Crainiceanu, AN and Nebel, MB and Caffo, B and Lindquist, MA and Crainiceanu, CM},
journal={Cognitive, Affective, & Behavioral Neuroscience},
volume={13},
number={4},
pages={714--724},
year={2013},
publisher={Springer}
}"
tfile = tempfile(fileext = "bib")
writeLines(x, con = tfile)
bib = bibtex::read.bib(tfile)
dir.create("inst", showWarnings = FALSE)
res = dput(bib, file = file.path("inst", "CITATION"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment