
Validate References in boilerplate Database
Source:R/bibliography-support.R
boilerplate_validate_references.Rd
Checks that all citations in the boilerplate text exist in the bibliography file.
Usage
boilerplate_validate_references(
db,
bib_file = NULL,
categories = c("methods", "results", "discussion", "appendix"),
quiet = FALSE
)
Examples
# \donttest{
# Create temporary directory for example
temp_dir <- tempfile()
dir.create(temp_dir)
# Initialise and import
boilerplate_init(data_path = temp_dir, create_dirs = TRUE, confirm = FALSE, quiet = TRUE)
db <- boilerplate_import(data_path = temp_dir, quiet = TRUE)
# Validate references
validation <- boilerplate_validate_references(db)
#> Migrated bibliography cache from old location to /Users/joseph/Library/Caches/org.R-project.R/R/boilerplate
#> ℹ No bibliography URL specified in database
#> ! No bibliography file available for validation
if (length(validation$missing) > 0) {
warning("Missing references: ", paste(validation$missing, collapse = ", "))
}
# Clean up
unlink(temp_dir, recursive = TRUE)
# }