Project Status: Active – The project has reached a stable, usable state and is being actively developed. cran checks R-check rstudio mirror downloads cran version


You can get this package at CRAN here, or install it within R by doing

Or install the development version from GitHub


What is this?

rplos is a package for accessing full text articles from the Public Library of Science journals using their API.


You used to need a key to use rplos - you no longer do as of 2015-01-13 (or v0.4.5.999).

rplos tutorial:

PLOS API documentation:

PLOS Solr schema is at but is 1.5 years old so may not be up to date.

Crossref API documentation here, and here. Note that we are working on a new package rcrossref (on CRAN) with a much fuller implementation of R functions for all Crossref endpoints.


Beware, PLOS recently has started throttling requests. That is, they will give error messages like “(503) Service Unavailable - The server cannot process the request due to a high load”, which means you’ve done too many requests in a certain time period. Here’s what they say on the matter:

Please limit your API requests to 7200 requests a day, 300 per hour, 10 per minute and allow 5 seconds for your search to return results. If you exceed this threshold, we will lock out your IP address. If you’re a high-volume user of the PLOS Search API and need more API requests a day, please contact us at to discuss your options. We currently limit API users to no more than five concurrent connections from a single IP address.

Quick start

Highlight searches

Search for and highlight the term alcohol in the abstract field only

(out <- highplos(q='alcohol', hl.fl = 'abstract', rows=3))
#> $`10.1371/journal.pone.0218147`
#> $`10.1371/journal.pone.0218147`$abstract
#> [1] "Background: Binge drinking, an increasingly common form of <em>alcohol</em> use disorder, is associated"
#> $`10.1371/journal.pone.0138021`
#> $`10.1371/journal.pone.0138021`$abstract
#> [1] "Background and Aim: Harmful <em>alcohol</em> consumption has long been recognized as being the major"
#> $`10.1371/journal.pone.0201042`
#> $`10.1371/journal.pone.0201042`$abstract
#> [1] "\nAcute <em>alcohol</em> administration can lead to a loss of control over drinking. Several models argue"

And you can browse the results in your default browser


Full text urls

Simple function to get full text urls for a DOI

#> [1] ""

Full text xml given a DOI

(out <- plos_fulltext(doi='10.1371/journal.pone.0086169'))
#> 1 full-text articles retrieved 
#> Min. Length: 110717 - Max. Length: 110717 
#> DOIs: 10.1371/journal.pone.0086169 ... 
#> NOTE: extract xml strings like output['<doi>']

Then parse the XML any way you like, here getting the abstract

xpathSApply(xmlParse(out$`10.1371/journal.pone.0086169`), "//abstract", xmlValue)
#> [1] "Mammalian females pay high energetic costs for reproduction, the greatest of which is imposed by lactation. The synthesis of milk requires, in part, the mobilization of bodily reserves to nourish developing young. Numerous hypotheses have been advanced to predict how mothers will differentially invest in sons and daughters, however few studies have addressed sex-biased milk synthesis. Here we leverage the dairy cow model to investigate such phenomena. Using 2.39 million lactation records from 1.49 million dairy cows, we demonstrate that the sex of the fetus influences the capacity of the mammary gland to synthesize milk during lactation. Cows favor daughters, producing significantly more milk for daughters than for sons across lactation. Using a sub-sample of this dataset (N = 113,750 subjects) we further demonstrate that the effects of fetal sex interact dynamically across parities, whereby the sex of the fetus being gestated can enhance or diminish the production of milk during an established lactation. Moreover the sex of the fetus gestated on the first parity has persistent consequences for milk synthesis on the subsequent parity. Specifically, gestation of a daughter on the first parity increases milk production by ∼445 kg over the first two lactations. Our results identify a dramatic and sustained programming of mammary function by offspring in utero. Nutritional and endocrine conditions in utero are known to have pronounced and long-term effects on progeny, but the ways in which the progeny has sustained physiological effects on the dam have received little attention to date."

Search within a field

There are a series of convience functions for searching within sections of articles.

For example:

plossubject(q='marine ecology',  fl = c('id','journal'), limit = 10)
#> $meta
#> # A tibble: 1 x 2
#>   numFound start
#>      <int> <int>
#> 1     2226     0
#> $data
#> # A tibble: 10 x 2
#>    id                                                  journal 
#>    <chr>                                               <chr>   
#>  1 10.1371/journal.pone.0092590/title                  PLoS ONE
#>  2 10.1371/journal.pone.0092590/abstract               PLoS ONE
#>  3 10.1371/journal.pone.0092590/references             PLoS ONE
#>  4 10.1371/journal.pone.0092590/body                   PLoS ONE
#>  5 10.1371/journal.pone.0092590/introduction           PLoS ONE
#>  6 10.1371/journal.pone.0092590/results_and_discussion PLoS ONE
#>  7 10.1371/journal.pone.0092590/materials_and_methods  PLoS ONE
#>  8 10.1371/journal.pone.0092590/conclusions            PLoS ONE
#>  9 10.1371/journal.pone.0092590                        PLoS ONE
#> 10 10.1371/journal.pone.0149852/body                   PLOS ONE

However, you can always just do this in searchplos() like searchplos(q = "subject:science"). See also the fq parameter. The above convenience functions are simply wrappers around searchplos, so take all the same parameters.

Search by article views

Search with term marine ecology, by field subject, and limit to 5 results

plosviews(search='marine ecology', byfield='subject', limit=5)
#>                             id counter_total_all
#> 3 10.1371/journal.pone.0167128              5057
#> 4 10.1371/journal.pone.0012946              5259
#> 1 10.1371/journal.pone.0092590             12601
#> 2 10.1371/journal.pone.0149852             18139
#> 5 10.1371/journal.pone.0011372             27681


Visualize word use across articles

plosword(list('monkey','Helianthus','sunflower','protein','whale'), vis = 'TRUE')
#> $table
#>   No_Articles       Term
#> 1       14310     monkey
#> 2         634 Helianthus
#> 3        1845  sunflower
#> 4      162008    protein
#> 5        2093      whale
#> $plot


progress bars

res <- searchplos(q='*:*', limit = 2000, progress = httr::progress())
#>  |=====================================| 100%
#>  |=====================================| 100%
#>  |=====================================| 100%
#>  |=====================================| 100%


This package is part of a richer suite called fulltext, along with several other packages, that provides the ability to search for and retrieve full text of open access scholarly articles. We recommend using fulltext as the primary R interface to rplos unless your needs are limited to this single source.