forked from ropensci-archive/rorcid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
156 lines (106 loc) · 4.05 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
rorcid
======
```{r echo=FALSE}
knitr::opts_chunk$set(
comment = "#>",
collapse = TRUE,
warning = FALSE,
message = FALSE
)
```
[![Build Status](https://api.travis-ci.org/ropensci/rorcid.png)](https://travis-ci.org/ropensci/rorcid)
[![Build status](https://ci.appveyor.com/api/projects/status/29hanha8jfe4uen8/branch/master?svg=true)](https://ci.appveyor.com/project/sckott/rorcid/branch/master)
[![codecov.io](https://codecov.io/github/ropensci/rorcid/coverage.svg?branch=master)](https://codecov.io/github/ropensci/rorcid?branch=master)
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/rorcid?color=2ED968)](https://github.com/metacran/cranlogs.app)
[![cran version](http://www.r-pkg.org/badges/version/rorcid)](https://cran.r-project.org/package=rorcid)
`rorcid` is an R programmatic interface to the Orcid public API. `rorcid` is not a product developed or distributed by ORCID®.
Orcid API docs:
* Public API docs: http://members.orcid.org/api
* Swagger docs: https://pub.orcid.org/v2.1/#/Public_API_v2.1
The package now works with the `v2.1` ORCID API now. It's too complicated to allow users to work with different versions of the API, so it's hard-coded to `v2.1`.
## Package API
```{r echo=FALSE, comment=NA, results='asis'}
cat(paste(" -", paste(sprintf("`%s`", getNamespaceExports("rorcid")), collapse = "\n - ")))
```
## Installation
Stable version
```{r eval=FALSE}
install.packages("rorcid")
```
Development version
```{r eval=FALSE}
install.packages("devtools")
devtools::install_github("ropensci/rorcid")
```
```{r}
library('rorcid')
```
## as.orcid
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.
```{r}
as.orcid(x = "0000-0002-1642-628X")
```
Or you can pass in many IDs
```{r}
as.orcid(c("0000-0003-1620-1408", "0000-0002-9341-7985"))
```
The `browse()` function lets you browser to a profile easily with a single function call
```{r eval=FALSE}
browse(as.orcid("0000-0002-1642-628X"))
```
![profile](http://f.cl.ly/items/3d1o0k1X3R1U110C0u1u/Screen%20Shot%202015-02-10%20at%207.21.57%20PM.png)
## Get works
The `works()` function helps get works data from an orcid data object. The output of `works()` is a data.frame
```{r}
(out <- works(orcid_id("0000-0002-0233-1757")))
```
## Search Orcid
Get a list of names and Orcid IDs matching a name query
```{r}
orcid(query = "carl boettiger")
```
You can string together many search terms
```{r}
orcid(query = "johnson cardiology houston")
```
And use boolean operators
```{r}
orcid("johnson AND(caltech OR 'California Institute of Technology')")
```
And you can use start and rows arguments to do pagination
```{r}
orcid("johnson cardiology houston", start = 2, rows = 3)
```
## Search by Orcid ID
```{r}
out <- orcid_id(orcid = "0000-0002-9341-7985")
out$`0000-0002-9341-7985`$name
```
## Search by DOIs
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
```{r}
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)
```
Some good, some bad
```{r}
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)
```
Basic search
```{r}
orcid_doi(dois = "10.1087/20120404")
```
This DOI is not a real one, but a partial DOI, then we can fuzzy search
```{r}
orcid_doi(dois = "10.1087/2", fuzzy = TRUE, rows = 5)
```
## Meta
* Please [report any issues or bugs](https://github.com/ropensci/rorcid/issues)
* License: MIT
* Get citation information for `rorcid` in R doing `citation(package = 'rorcid')`
* Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
[![ropensci_footer](https://ropensci.org/public_images/github_footer.png)](https://ropensci.org)