pmid_to_ftp: Convert PubMed IDs (PMIDs) to PMC IDs and Full-Text URLs
Description
This function converts PMIDs to PMC IDs, then fetches the full-text file URLs
from the PMC Open Access service. It combines both steps into a single workflow.
url: The full HTTPS URL for downloading PMC full text
Results are filtered to only include rows with valid URLs (open access articles),
ordered by PMID. Returns NULL with a message if the API is unavailable or returns invalid data.
Arguments
pmids
A character or numeric vector of PubMed IDs (PMIDs) to convert.
batch_size
An integer specifying the number of PMIDs to process per
batch for ID conversion. Defaults to 200L. The NCBI API has limitations on batch sizes.
sleep
A numeric value specifying the number of seconds to pause
between API requests for ID conversion (Step 1). Defaults to 0.5 seconds.
For OA API calls (Step 2), sleep time is automatically adjusted based on
rate limits: 0.11s with API key (10 req/sec), 0.34s without (3 req/sec).
verbose
Logical, whether to print progress messages. Defaults to FALSE.