knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(citationcheckR)
After you have finished filling up your citation and file and want to check if the citations are correct, check_bibtex_file
is very useful. This function is a mix between the check_bibtex_citations
and check_citation_file
functions. It will go through the citation file and return any issues with the citations given.
For this example, we will use an example file which contains citations for Lahman
, tidyverse
and R:
@Manual{, title = {Lahman: Sean 'Lahman' Baseball Database}, author = {Michael Friendly and Chris Dalzell and Martin Monkman and Dennis Murphy}, year = {2021}, note = {R package version 9.0-0}, url = {https://CRAN.R-project.org/package=Lahman}, } @Article{, title = {Welcome to the {tidyverse}}, author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani}, year = {2019}, journal = {Journal of Open Source Software}, volume = {4}, number = {43}, pages = {1686}, doi = {10.21105/joss.01686}, } @Manual{, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2019}, url = {https://www.R-project.org/}, }
check_bibtex_file("example.bib", c("Lahman", "tidyverse", "base"))
The function will go through each package citation and tell you if there are any issues. To avoid any confusion, it will tell you which package it is checking before returning any issues.
For this example, we will use an example file which contains citations for Lahman
, tidyverse
and R. There will be issues with the Lahman
and tidyverse
citations:
@Manual{, title = {Lahman: Sean 'Lahman' Baseball Database}, author = {Michael Friendly}, year = {2021}, note = {R package version 9.0-0}, url = {https://CRAN.R-project.org/package=Lahman}, } @Article{, title = {Welcome to the {tidyverse}}, author = {Hadley Wickham}, year = {2019}, journal = {Journal of Open Source Software}, volume = {4}, number = {43}, pages = {1686}, doi = {10.21105/joss.01686}, } @Manual{, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2019}, url = {https://www.R-project.org/}, }
check_bibtex_file("incorrect_example.bib", c("Lahman", "tidyverse", "base"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.