Package 'DOIcreator'

Title: Append DOIs to References in Word Documents
Description: DOIcreator is an R package that reads Word documents containing bibliographic references, searches for their corresponding DOIs via the CrossRef API, and appends the DOIs directly to the references. It supports parallel processing for faster retrieval and outputs a new Word document with numbered references including DOIs.
Authors: Umar Hussain [aut, cre]
Maintainer: Umar Hussain <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-05-12 06:52:32 UTC
Source: https://github.com/umarhussain-git/doicreator

Help Index


Add DOIs to References in a Word Document

Description

This function reads a Word document containing bibliographic references, fetches their corresponding DOIs via the CrossRef API, and writes a new Word document with the DOIs appended to each reference.

Usage

add_doi(input_path, output_path, reference_lines = 50)

Arguments

input_path

Character. Path to the input Word document (.docx) containing references. Can be absolute (e.g., "C:/Users/.../references.docx") or relative (e.g., "./references.docx").

output_path

Character. Path where the output Word document with DOIs will be saved. If the file exists, it will be overwritten.

reference_lines

Numeric. Number of lines from the end of the document to treat as references. Default is 50. Only lines with more than 30 characters are processed.

Value

Character vector of references with appended DOIs. References that could not be matched return "NA".

Examples

## Not run: 
# Basic usage: fetch DOIs for last 50 lines in a Word document
add_doi(
  input_path  = "E:/references.docx",
  output_path = "E:/references_doi.docx",
  reference_lines = 50
)

# Notes:
# - input_path must exist and contain references.
# - output_path will be overwritten if it exists.
# - Some references may return DOI "NA" if not found on CrossRef.

## End(Not run)