| Title: | Correct and Standardize References for Scientific Manuscripts |
|---|---|
| Description: | Reads 'Word' documents containing incomplete bibliographic references and produces an updated file with standardized and complete references. The package provides functions to retrieve missing authors, titles, journal details, volume, issue, and page numbers. Digital object identifiers (DOIs) are retrieved using the 'CrossRef' application programming interface (API) <https://api.crossref.org>, and references are formatted following DOI-based citation standards as described by Paskin (2010) <doi:10.1000/182> and the 'citation.doi.org' service <https://citation.doi.org>. The package is intended to simplify reference preparation for scientific journal submissions. |
| Authors: | Umar Hussain [aut, cre] |
| Maintainer: | Umar Hussain <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.2 |
| Built: | 2026-05-13 07:32:22 UTC |
| Source: | https://github.com/cran/correctref |
Reads a 'Word' document containing bibliographic references with missing or incomplete information (e.g., authors, title, year, volume, issue, or page numbers) and produces an updated document with standardized and completed references. Missing metadata are retrieved using the 'CrossRef' application programming interface (API), and digital object identifiers (DOIs) are added where available.
correct_ref(input_path, output_path, reference_lines = 50, style = "vancouver")correct_ref(input_path, output_path, reference_lines = 50, style = "vancouver")
input_path |
Character string specifying the path to the input 'Word' (.docx) document containing incomplete references. |
output_path |
Character string specifying the path where the corrected 'Word' document will be written. |
reference_lines |
Integer specifying the number of lines at the end of the document that are treated as references. |
style |
Character string specifying the reference style (e.g.,
|
Writes a corrected 'Word' document to the location specified by
output_path. The function returns invisible(NULL).
library(officer) # Step 1: Create a temporary Word document with sample references tmp_input <- file.path(tempdir(), "tmp_refs.docx") doc <- read_docx() doc <- body_add_par(doc, "1. Smith J. Some article. 2020;10(2):123-9.", style = "Normal") doc <- body_add_par(doc, "2. Doe A. Another article. 2021;5(1):10-5.", style = "Normal") print(doc, target = tmp_input) # Step 2: Specify output path tmp_output <- file.path(tempdir(), "updated_refs.docx") # Step 3: Run the reference correction function correct_ref( input_path = tmp_input, output_path = tmp_output, reference_lines = 2, style = "vancouver" ) # Step 4: The corrected Word file is saved in tmp_output tmp_outputlibrary(officer) # Step 1: Create a temporary Word document with sample references tmp_input <- file.path(tempdir(), "tmp_refs.docx") doc <- read_docx() doc <- body_add_par(doc, "1. Smith J. Some article. 2020;10(2):123-9.", style = "Normal") doc <- body_add_par(doc, "2. Doe A. Another article. 2021;5(1):10-5.", style = "Normal") print(doc, target = tmp_input) # Step 2: Specify output path tmp_output <- file.path(tempdir(), "updated_refs.docx") # Step 3: Run the reference correction function correct_ref( input_path = tmp_input, output_path = tmp_output, reference_lines = 2, style = "vancouver" ) # Step 4: The corrected Word file is saved in tmp_output tmp_output