
Get Annual PubMed Article Counts for a Search Term
Source:R/get_pubmed_data.R
get_pubmed_by_year.RdThis function queries the NCBI E-utilities API to retrieve the number of PubMed articles published each year over a specified number of past years for a given search term or package name.
Usage
get_pubmed_by_year(
package_name,
years_back = 10,
api_key = getOption("pubmed.api_key", NULL)
)Arguments
- package_name
A character string representing the search term (e.g., an R package name).
- years_back
An integer specifying how many years back to query. Defaults to 10.
- api_key
Optional. A character string with an NCBI API key. If not supplied, it will attempt to use the option
getOption("pubmed.api_key").