mt_sample_pubmed: A random sample from PubMed

View source: R/mt_sample_pubmed.R

mt_sample_pubmedR Documentation

A random sample from PubMed

Description

Identify a random sample of articles from PubMed. Note that this function retrieves the currently available articles from PubMed, so it requires internet connection to search PubMed and download the results. Depending on the connection and selected years, this can take at least a few minutes to run. Note that these samples will change with changes in the data provided by PubMed, for which reason a "Data sampled" column is added as a time-stamp. Please also consider using a seed to improve reproducibility and do not run this function repeatedly.

Usage

mt_sample_pubmed(n = 1000, year_min = 2020, year_max = 2020, seed = NULL)

Arguments

n

The number of articles to sample, as a numeric.

year_min

The minimum year to sample from inclusive, as a numeric. By PubMed definition, this is the year of record creation.

year_max

The maximum year to sample from inclusive, as a numeric. By PubMed definition, this is the year of record creation.

seed

Provide a seed for a reproducible sample, as a numeric.

Value

A tibble of randomly sampled articles and their PMID and Date sampled in yyyy-mm-dd.


serghiou/metareadr documentation built on Aug. 21, 2023, 2:33 a.m.