Learn R Programming

rcrossref (version 0.5.2)

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, facet = FALSE, works = FALSE, cursor = NULL, cursor_max = 5000, .progress = "none", ...)
cr_funders(dois = NULL, query = NULL, filter = NULL, offset = NULL, limit = NULL, sample = NULL, sort = NULL, order = NULL, facet = FALSE, works = FALSE, cursor = NULL, cursor_max = 5000, .progress = "none", ...)
cr_funders_(dois = NULL, query = NULL, filter = NULL, offset = NULL, limit = NULL, sample = NULL, sort = NULL, order = NULL, facet = FALSE, works = FALSE, cursor = NULL, cursor_max = 5000, .progress = "none", parse = FALSE, ...)

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. Ignored unless works=TRUE
sort
(character) Field to sort on, one of score, relevance, updated, deposited, indexed, or published.
order
(character) Sort order, one of 'asc' or 'desc'
facet
(logical) Include facet results. Default: FALSE
works
(logical) If TRUE, works returned as well, if not then not.
cursor
(character) Cursor character string to do deep paging. Default is None. Pass in '*' to start deep paging. Any combination of query, filters and facets may be used with deep paging cursors. While rows may be specified along with cursor, offset and sample cannot be used. See https://github.com/CrossRef/rest-api-doc/blob/master/rest_api.md#deep-paging-with-cursors
cursor_max
(integer) Max records to retrieve. Only used when cursor param used. Because deep paging can result in continuous requests until all are retrieved, use this parameter to set a maximum number of records. Of course, if there are less records found than this value, you will get only those found.
.progress
Show a plyr-style progress bar? Options are "none", "text", "tk", "win", and "time". See create_progress_bar for details of each. Only used when passing in multiple ids (e.g., multiple DOIs, DOI prefixes, etc.)
...
Named parameters passed on to GET
parse
(logical) Whether to output json FALSE or parse to list TRUE. Default: FALSE

NOTE

Funders without IDs don't show up on the /funders route, and in this function. Some funders don't have assigned IDs in Crossref's system, so won't show up in searches.

Details

BEWARE: The API will only work for CrossRef DOIs.

This function name changing to cr_funders in the next version - both work for now

References

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

Examples

Run this code
## Not run: 
# cr_funders(query="NSF", limit=1)
# cr_funders(query="NSF")
# cr_funders(dois='10.13039/100000001')
# out <- cr_funders(dois=c('10.13039/100000001','10.13039/100000015'))
# out['10.13039/100000001']
# out[['10.13039/100000001']]
# 
# cr_funders(dois='10.13039/100000001')
# cr_funders(dois='10.13039/100000001', works=TRUE, limit=5)
# 
# cr_funders(dois=c('10.13039/100000001','10.13039/100000015'))
# cr_funders(dois=c('10.13039/100000001','10.13039/100000015'), works=TRUE)
# 
# # Curl options
# library('httr')
# cr_funders(dois='10.13039/100000001', config=verbose())
# 
# # If not found, and > 1 DOI given, those not found dropped
# cr_funders(dois=c("adfadfaf","asfasf"))
# cr_funders(dois=c("adfadfaf","asfasf"), works=TRUE)
# cr_funders(dois=c("10.13039/100000001","asfasf"))
# cr_funders(dois=c("10.13039/100000001","asfasf"), works=TRUE)
# 
# # Use the cursor for deep paging
# cr_funders('100000001', works = TRUE, cursor = "*", cursor_max = 500, limit = 100)
# cr_funders(c('100000001', '100000002'), works = TRUE, cursor = "*",
#    cursor_max = 300, limit = 100) 
#    
# # Low level function - does no parsing to data.frame, get json or a list
# cr_funders_(query = 'nsf')
# cr_funders_('10.13039/100000001')
# cr_funders_(query = 'science', parse=TRUE)
# cr_funders_('10.13039/100000001', works = TRUE, cursor = "*", 
#    cursor_max = 300, limit = 100)
# cr_funders_('10.13039/100000001', works = TRUE, cursor = "*", 
#    cursor_max = 300, limit = 100, parse = TRUE)
# ## End(Not run)

Run the code above in your browser using DataLab