Learn R Programming

rcrossref (version 0.3.0)

cr_fundref: Search the CrossRef Fundref API

Description

Search the CrossRef Fundref API

Usage

cr_fundref(dois = NULL, query = NULL, filter = NULL, offset = NULL,
  limit = NULL, sample = NULL, sort = NULL, order = NULL,
  works = FALSE, .progress = "none", ...)

Arguments

dois
Search by a single DOI or many DOIs.
query
Query terms
filter
Filter options. See details.
offset
Number of record to start at, from 1 to infinity.
limit
Number of results to return in the query. Not relavant when searching with specific dois. Default: 20. Max: 1000
sample
(integer) Number of random results to return. when you use the sample parameter, the rows and offset parameters are ignored.
sort
(character) Field to sort on, one of score, relevance, updated, deposited, indexed, or published.
order
(character) Sort order, one of 'asc' or 'desc'
works
(logical) If TRUE, works returned as well, if not then not.
.progress
Show a plyr-style progress bar? Options are "none", "text", "tk", "win, and "time". See create_progress_bar for details of each.
...
Named parameters passed on to GET

Details

BEWARE: The API will only work for CrossRef DOIs.

References

https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md

Examples

Run this code
cr_fundref(query="NSF", limit=1)
cr_fundref(query="NSF")
cr_fundref(dois='10.13039/100000001')
out <- cr_fundref(dois=c('10.13039/100000001','10.13039/100000015'))
out['10.13039/100000001']
out[['10.13039/100000001']]

cr_fundref(dois='10.13039/100000001')
cr_fundref(dois='10.13039/100000001', works=TRUE, limit=5)

cr_fundref(dois=c('10.13039/100000001','10.13039/100000015'))
cr_fundref(dois=c('10.13039/100000001','10.13039/100000015'), works=TRUE)

# Curl options
library('httr')
cr_fundref(dois='10.13039/100000001', config=verbose())

# If not found, and only 1 DOI given, list of NA elements returned
cr_fundref("adfadfaf")
# If not found, and > 1 DOI given, those not found dropped
cr_fundref(dois=c("adfadfaf","asfasf"))
cr_fundref(dois=c("adfadfaf","asfasf"), works=TRUE)
cr_fundref(dois=c("10.13039/100000001","asfasf"))
cr_fundref(dois=c("10.13039/100000001","asfasf"), works=TRUE)

Run the code above in your browser using DataLab