-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
47 lines (33 loc) · 2.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
# R Client for Publons.com
**rpublons** is a package for extracting data from [Publons.com](https://publons.com), a site for publicly reporting scholarly peer review activity. Use of the package requires a Publons account. The username and password combination are used retrieve an API token. You can either set your username and password via environment variables or use `publons_auth()` to retrieve (and set) the API token as an environment variable. This is long-lived, so you can also set the `PUBLONS_TOKEN` environment variable (once you have it) and avoid the authorization handshake.
The package currently provides a minimalist API client.
```{r}
library("rpublons")
if (Sys.getenv("PUBLONS_TOKEN") == "") {
publons_auth("myusername", "mypassword")
}
# get list of academics
publons("GET", "academic/")
# get academics by institution
publons("GET", "academic/", query = list(institution = "Harvard University"))
# get a specific academic by ORCiD
publons("GET", paste0("academic/", "0000-0003-4097-6326"))
# get reviews for a specific academic by ORCiD
publons("GET", "academic/review/",
query = list(academic = "0000-0003-4097-6326"))
# get a specific review
publons("GET", paste0("academic/review/", "YK8zafgo"))
```
## Installation
[](https://cran.r-project.org/package=rpublons)

[](https://travis-ci.org/leeper/rpublons)
[](https://ci.appveyor.com/project/leeper/rpublons)
[](https://codecov.io/github/leeper/rpublons?branch=master)
This package is not yet on CRAN. To install the latest development version you can install pull a potentially unstable version directly from GitHub:
```R
if (!require("remotes")) {
install.packages("remotes")
}
remotes::install_github("leeper/rpublons")
```