Skip to content

ropensci/medrxivr

Repository files navigation

medrxivr

Project Status: Active – The project has reached a stable, usable state and is being actively developed.
Travis build status AppVeyor build status Codecov test coverage

The goal of medrxivr is to provide programmatic access to the medRxiv preprint repository.

Installation

You can install the development version of this package using:

devtools::install_github("mcguinlu/medrxivr")

Example

To get the entire medRxiv dataset to play around with, use the following command:

mx_results <- mx_search("*")

For a simple search strategy:

mx_results <- mx_search("dementia")

To find records that contain one of many keywords:

myquery <- c("dementia","vascular","alzheimer's") # Combined with OR

mx_results <- mx_search(myquery)

To combine different topic domains (currently, you can have up to 5 topics):

topic1  <- c("dementia","vascular","alzheimer's")  # Combined with OR
topic2  <- c("lipids","statins","cholesterol")     # Combined with OR
myquery <- list(topic1, topic2)                    # Combined with AND

mx_results <- mx_search(myquery)

Download PDFs

Pass the results of your search above to the mx_download() function to download a copy of the PDF for each record. Note: PDFs are saved using the value of the node column in the dataset, which serves as a unique identifier for each record.

mx_download(mx_results,     # Object returned by mx_search
            "pdf/",         # Directory to save PDFs to 
            create = TRUE)  # Create the directory if it doesn't exist

Code of conduct

Please note that the medrxivr project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.