-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathREADME.rmd
96 lines (70 loc) · 1.86 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
---
title: "wosr"
output: github_document
---
```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
progress = FALSE,
error = FALSE,
message = FALSE,
warning = FALSE
)
options(digits = 2)
```
> R clients to the Web of Science and Incites APIs
[![Linux Build Status](https://travis-ci.org/vt-arc/wosr.svg?branch=master)](https://travis-ci.org/vt-arc/wosr)
[![CRAN version](http://www.r-pkg.org/badges/version/wosr)](https://cran.r-project.org/package=wosr)
## Installation
You can get the stable version from CRAN:
```r
install.packages("wosr")
```
Or the development version from GitHub:
```r
if (!"devtools" %in% rownames(installed.packages()))
install.packages("devtools")
devtools::install_github("vt-arc/wosr")
```
## Web of Science
```{r, eval = FALSE}
library(wosr)
# Save your WoS API username and password in environment variables
Sys.setenv(WOS_USERNAME = "your_username", WOS_PASSWORD = "your_password")
# Get session ID
sid <- auth()
```
```{r, echo = FALSE}
library(wosr)
sid <- auth()
```
```{r}
# Query WoS to see how many results match your query
query <- 'TS = ("animal welfare") AND PY = (2002-2003)'
query_wos(query, sid = sid)
```
```{r}
# Download data
pull_wos(query, sid = sid)
```
## InCites
```{r, eval = FALSE}
# Save your InCites developer key in an environment variable
Sys.setenv(INCITES_KEY = "your_key")
```
```{r}
# Vector of UTs (publication identifiers) to get InCites data for
uts <- c("000272272000015", "000272366800025", "000272877700013")
# Download InCites data for those UTs
pull_incites(uts)
```
## Web of Science and InCites
```{r}
# Download WoS data
wos <- pull_wos('TS = ("dog welfare")', sid = sid)
# Download InCites data
head(pull_incites(wos$publication$ut))
```
## Learning more
* To learn more, head over to `wosr`'s [webpage](https://vt-arc.github.io/wosr/index.html).