doi: (character) One or more digital object identifiers. If async=FALSE we do synchronous HTTP requests in an lapply call, but if async=TRUE, we do asynchronous HTTP requests.
url: (character) the url for the function (should be left to default)
key: your Crossref OpenURL email address, either enter, or loads from .Rprofile. We use a default, so you don't need to pass this.
async: (logical) use async HTTP requests. Default: FALSE
...: Curl options passed on to crul::HttpClient()
Returns
a data.frame, with columns doi and count. The count column has numeric values that are the citation count for that DOI, or NA if not found or no count available
Note that this number may be out of sync/may not match that that the publisher is showing (if they show it) for the same DOI/article.
We've contacted Crossref about this, and they have confirmed this. Unfortunately, we can not do anything about this.
I would imagine it's best to use this data instead of from the publishers, and this data you can get programatically :)
failure behavior
When a DOI does not exist, we may not get a proper HTTP status code to throw a proper stop status, so we grep on the text itself, and throw a stop if only one DOI passed and not using async, or warning if more than one DOI passed or if using async.
Examples
## Not run:cr_citation_count(doi="10.1371/journal.pone.0042793")cr_citation_count(doi="10.1016/j.fbr.2012.01.001")## manydois <- c("10.1016/j.fbr.2012.01.001","10.1371/journal.pone.0042793")cr_citation_count(doi = dois)# DOI not foundcr_citation_count(doi="10.1016/j.fbr.2012")# asycdois <- c("10.1016/j.fbr.2012.01.001","10.1371/journal.pone.0042793","10.1016/j.fbr.2012","10.1109/tsp.2006.874779","10.1007/bf02231542","10.1007/s00277-016-2782-z","10.1002/9781118339893.wbeccp020","10.1177/011542659200700105","10.1002/chin.197444438","10.1002/9781118619599.ch4","10.1007/s00466-012-0724-8","10.1017/s0376892900029477","10.1167/16.12.824")res <- cr_citation_count(doi = dois, async =TRUE)## verbose curlres <- cr_citation_count(doi = dois, async =TRUE, verbose =TRUE)res
## time comparisonsystem.time(cr_citation_count(doi = dois, async =TRUE))system.time(cr_citation_count(doi = dois, async =FALSE))# from a set of random DOIscr_citation_count(cr_r(50), async =TRUE)## End(Not run)