rorcid
is an R programmatic interface to the Orcid public API. rorcid
is not a product developed or distributed by ORCID®.
Orcid API docs: http://members.orcid.org/api
The package now works with the v3.0
ORCID API. It's too complicated to allow users to work with different versions of the API, so it's hard-coded to v3.0
.
library("rorcid")
There's a function as.orcid()
in this package to help coerce an Orcid ID to an object that holds details for that Orcid ID, prints a nice summary, and you can browse easily to that profile. E.g.
as.orcid(x = "0000-0002-1642-628X") #> <ORCID> 0000-0002-1642-628X #> Name: Boettiger, Carl #> URL (first): http://www.carlboettiger.info #> Country: US #> Keywords: Ecology, Evolution, Regime Shifts, Stochastic Dynamics
Or you can pass in many IDs
as.orcid(c("0000-0003-1620-1408", "0000-0002-9341-7985")) #> [[1]] #> <ORCID> 0000-0003-1620-1408 #> Name: Johnson, Thomas #> URL (first): #> Country: US #> Keywords: #> #> [[2]] #> <ORCID> 0000-0002-9341-7985 #> Name: Binfield, Peter #> URL (first): #> Country: US #> Keywords:
The browse()
function lets you browser to a profile easily with a single function call
browse(as.orcid("0000-0002-1642-628X"))
The works()
function helps get works data from an orcid data object. The output of works()
uses a print method to just print citations for each work.
(out <- works(orcid_id("0000-0002-0233-1757"))) #> # A tibble: 6 x 32 #> `put-code` url type `journal-title` visibility path `display-index` #> * <int> <lgl> <chr> <lgl> <chr> <chr> <chr> #> 1 5296064 NA jour… NA public /000… 0 #> 2 5296065 NA jour… NA public /000… 0 #> 3 5296066 NA jour… NA public /000… 0 #> 4 9012984 NA jour… NA public /000… 0 #> 5 9012985 NA jour… NA public /000… 0 #> 6 9012986 NA jour… NA public /000… 0 #> # … with 25 more variables: `created-date.value` <dbl>, #> # `last-modified-date.value` <dbl>, `source.source-client-id` <lgl>, #> # `source.assertion-origin-orcid` <lgl>, #> # `source.assertion-origin-client-id` <lgl>, #> # `source.assertion-origin-name` <lgl>, `source.source-orcid.uri` <chr>, #> # `source.source-orcid.path` <chr>, `source.source-orcid.host` <chr>, #> # `source.source-name.value` <chr>, title.subtitle <lgl>, #> # `title.translated-title` <lgl>, title.title.value <chr>, #> # `external-ids.external-id` <list>, `publication-date.year.value` <chr>, #> # `publication-date.month.value` <chr>, `publication-date.day.value` <chr>, #> # `publication-date.day` <lgl>, `external-ids` <lgl>, #> # `publication-date` <lgl>, `source.source-orcid` <lgl>, #> # `source.source-client-id.uri` <chr>, `source.source-client-id.path` <chr>, #> # `source.source-client-id.host` <chr>, url.value <chr>
Get a list of names and Orcid IDs matching a name query
orcid(query = "carl boettiger") #> # A tibble: 1,000 x 3 #> `orcid-identifier.uri` `orcid-identifier.pa… `orcid-identifier.ho… #> * <chr> <chr> <chr> #> 1 https://orcid.org/0000-0002-1642… 0000-0002-1642-628X orcid.org #> 2 https://orcid.org/0000-0002-5951… 0000-0002-5951-4503 orcid.org #> 3 https://orcid.org/0000-0002-3554… 0000-0002-3554-5196 orcid.org #> 4 https://orcid.org/0000-0003-1853… 0000-0003-1853-1574 orcid.org #> 5 https://orcid.org/0000-0002-7462… 0000-0002-7462-1956 orcid.org #> 6 https://orcid.org/0000-0002-7790… 0000-0002-7790-5102 orcid.org #> 7 https://orcid.org/0000-0003-1021… 0000-0003-1021-5374 orcid.org #> 8 https://orcid.org/0000-0001-8899… 0000-0001-8899-7850 orcid.org #> 9 https://orcid.org/0000-0001-7084… 0000-0001-7084-5402 orcid.org #> 10 https://orcid.org/0000-0003-0241… 0000-0003-0241-3557 orcid.org #> # … with 990 more rows
You can string together many search terms
orcid(query = "johnson cardiology houston") #> # A tibble: 1,000 x 3 #> `orcid-identifier.uri` `orcid-identifier.pa… `orcid-identifier.ho… #> * <chr> <chr> <chr> #> 1 https://orcid.org/0000-0002-0897… 0000-0002-0897-2301 orcid.org #> 2 https://orcid.org/0000-0002-5281… 0000-0002-5281-4466 orcid.org #> 3 https://orcid.org/0000-0001-8188… 0000-0001-8188-0078 orcid.org #> 4 https://orcid.org/0000-0002-2862… 0000-0002-2862-4160 orcid.org #> 5 https://orcid.org/0000-0002-0682… 0000-0002-0682-9982 orcid.org #> 6 https://orcid.org/0000-0002-4334… 0000-0002-4334-4001 orcid.org #> 7 https://orcid.org/0000-0002-6401… 0000-0002-6401-4597 orcid.org #> 8 https://orcid.org/0000-0003-4792… 0000-0003-4792-0149 orcid.org #> 9 https://orcid.org/0000-0001-9667… 0000-0001-9667-1615 orcid.org #> 10 https://orcid.org/0000-0003-0945… 0000-0003-0945-6138 orcid.org #> # … with 990 more rows
And you can use start and rows arguments to do pagination
orcid("johnson cardiology houston", start = 2, rows = 3) #> # A tibble: 3 x 3 #> `orcid-identifier.uri` `orcid-identifier.pat… `orcid-identifier.ho… #> * <chr> <chr> <chr> #> 1 https://orcid.org/0000-0001-8188… 0000-0001-8188-0078 orcid.org #> 2 https://orcid.org/0000-0002-2862… 0000-0002-2862-4160 orcid.org #> 3 https://orcid.org/0000-0002-0682… 0000-0002-0682-9982 orcid.org
out <- orcid_id(orcid = "0000-0002-9341-7985") out$`0000-0002-9341-7985`$addresses #> $`last-modified-date` #> $`last-modified-date`$value #> [1] 1.465227e+12 #> #> #> $address #> visibility path put-code display-index #> 1 public /0000-0002-9341-7985/address/89515 89515 0 #> created-date.value last-modified-date.value source.source-client-id #> 1 1.453659e+12 1.465227e+12 NA #> source.assertion-origin-orcid source.assertion-origin-client-id #> 1 NA NA #> source.assertion-origin-name source.source-orcid.uri #> 1 NA https://orcid.org/0000-0002-9341-7985 #> source.source-orcid.path source.source-orcid.host source.source-name.value #> 1 0000-0002-9341-7985 orcid.org Peter Binfield #> country.value #> 1 US #> #> $path #> [1] "/0000-0002-9341-7985/address"
There is a helper function check_dois()
that uses a regex checker to see if your DOIs are likely good or likely bad:
All good DOIs
dois <- c("10.1371/journal.pone.0025995","10.1371/journal.pone.0053712", "10.1371/journal.pone.0054608","10.1371/journal.pone.0055937") check_dois(dois) #> $good #> [1] "10.1371/journal.pone.0025995" "10.1371/journal.pone.0053712" #> [3] "10.1371/journal.pone.0054608" "10.1371/journal.pone.0055937" #> #> $bad #> NULL
Some good, some bad
dois <- c("10.1016/j.medpal.2008.12.005","10.1080/00933104.2000.10505926","10.1037/a0024480", "10.1002/anie.196603172","2344","asdf","232","asdf","23dd") check_dois(dois) #> $good #> [1] "10.1016/j.medpal.2008.12.005" "10.1080/00933104.2000.10505926" #> [3] "10.1037/a0024480" "10.1002/anie.196603172" #> #> $bad #> [1] "2344" "asdf" "232" "asdf" "23dd"
Basic search
orcid_doi(dois = "10.1087/20120404") #> [[1]] #> # A tibble: 13 x 3 #> `orcid-identifier.uri` `orcid-identifier.pa… `orcid-identifier.ho… #> * <chr> <chr> <chr> #> 1 https://orcid.org/0000-0002-3181… 0000-0002-3181-3456 orcid.org #> 2 https://orcid.org/0000-0002-1290… 0000-0002-1290-9735 orcid.org #> 3 https://orcid.org/0000-0001-7343… 0000-0001-7343-9784 orcid.org #> 4 https://orcid.org/0000-0003-3738… 0000-0003-3738-1487 orcid.org #> 5 https://orcid.org/0000-0001-5727… 0000-0001-5727-2427 orcid.org #> 6 https://orcid.org/0000-0003-1603… 0000-0003-1603-8743 orcid.org #> 7 https://orcid.org/0000-0002-2123… 0000-0002-2123-6317 orcid.org #> 8 https://orcid.org/0000-0002-0860… 0000-0002-0860-8606 orcid.org #> 9 https://orcid.org/0000-0003-0493… 0000-0003-0493-0128 orcid.org #> 10 https://orcid.org/0000-0003-3188… 0000-0003-3188-6273 orcid.org #> 11 https://orcid.org/0000-0002-5993… 0000-0002-5993-8592 orcid.org #> 12 https://orcid.org/0000-0003-1419… 0000-0003-1419-2405 orcid.org #> 13 https://orcid.org/0000-0001-5109… 0000-0001-5109-3700 orcid.org #> #> attr(,"class") #> [1] "orcid_doi"
This DOI is not a real one, but a partial DOI, then we can fuzzy search
orcid_doi(dois = "10.1087/2", fuzzy = TRUE, rows = 5) #> [[1]] #> # A tibble: 5 x 3 #> `orcid-identifier.uri` `orcid-identifier.pat… `orcid-identifier.ho… #> * <chr> <chr> <chr> #> 1 https://orcid.org/0000-0001-8701… 0000-0001-8701-615X orcid.org #> 2 https://orcid.org/0000-0001-6081… 0000-0001-6081-0708 orcid.org #> 3 https://orcid.org/0000-0001-5919… 0000-0001-5919-8670 orcid.org #> 4 https://orcid.org/0000-0002-0634… 0000-0002-0634-3376 orcid.org #> 5 https://orcid.org/0000-0001-8959… 0000-0001-8959-3380 orcid.org #> #> attr(,"class") #> [1] "orcid_doi"
Function is vectorized, search for many DOIs
dois <- c("10.1371/journal.pone.0025995","10.1371/journal.pone.0053712", "10.1371/journal.pone.0054608","10.1371/journal.pone.0055937") res <- orcid_doi(dois = dois, fuzzy = TRUE) res[[1]] #> # A tibble: 1,000 x 3 #> `orcid-identifier.uri` `orcid-identifier.pa… `orcid-identifier.ho… #> * <chr> <chr> <chr> #> 1 https://orcid.org/0000-0002-0051… 0000-0002-0051-973X orcid.org #> 2 https://orcid.org/0000-0001-7767… 0000-0001-7767-3500 orcid.org #> 3 https://orcid.org/0000-0001-6577… 0000-0001-6577-5526 orcid.org #> 4 https://orcid.org/0000-0001-9637… 0000-0001-9637-4127 orcid.org #> 5 https://orcid.org/0000-0002-3461… 0000-0002-3461-9990 orcid.org #> 6 https://orcid.org/0000-0002-0153… 0000-0002-0153-9708 orcid.org #> 7 https://orcid.org/0000-0003-1403… 0000-0003-1403-7093 orcid.org #> 8 https://orcid.org/0000-0002-5591… 0000-0002-5591-5721 orcid.org #> 9 https://orcid.org/0000-0003-0551… 0000-0003-0551-2550 orcid.org #> 10 https://orcid.org/0000-0003-4410… 0000-0003-4410-6539 orcid.org #> # … with 990 more rows
One workflow is to get publications associated with an ORCID profile. The following will extract all the works with a DOI, then use the rcrossref
package to get nicely formatted references for each, and then export them to a bibtex file
my_dois <- rorcid::identifiers(rorcid::works("0000-0002-0337-5997")) pubs <- rcrossref::cr_cn(dois = my_dois, format = "bibtex") invisible(lapply(pubs, write, "pubs.bib", append=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.