Installation

You can get the stable version from CRAN

install.packages("wosr")

Or the development version from GitHub

if (!"devtools" %in% rownames(installed.packages())) 
  install.packages("devtools")

devtools::install_github("vt-arc/wosr")

Web of Science

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()
# Query WoS to see how many results match your query
query <- 'TS = ("animal welfare") AND PY = (2002-2003)'
query_wos(query, sid = sid)
#> Matching records: 548
# Download data
pull_wos(query, sid = sid)
#> List of 9
#>  $ publication   :'data.frame':  548 obs. of  7 variables:
#>   ..$ ut       : chr [1:548] "WOS:000173956100001" ...
#>   ..$ title    : chr [1:548] "FMD and animal welfare" ...
#>   ..$ journal  : chr [1:548] "Veterinary Record" ...
#>   ..$ date     : Date[1:548], format: "2002-01-26" ...
#>   ..$ doi      : chr [1:548] NA ...
#>   ..$ tot_cites: num [1:548] 0 0 ...
#>   ..$ abstract : chr [1:548] NA ...
#>  $ author        :'data.frame':  1438 obs. of  7 variables:
#>   ..$ ut          : chr [1:1438] "WOS:000176714800003" ...
#>   ..$ author_no   : num [1:1438] 1 1 ...
#>   ..$ display_name: chr [1:1438] "Nolen, RS" ...
#>   ..$ first_name  : chr [1:1438] "RS" ...
#>   ..$ last_name   : chr [1:1438] "Nolen" ...
#>   ..$ email       : chr [1:1438] NA ...
#>   ..$ daisng_id   : num [1:1438] 25184 ...
#>  $ address       :'data.frame':  838 obs. of  7 variables:
#>   ..$ ut      : chr [1:838] "WOS:000182036200014" ...
#>   ..$ addr_no : num [1:838] 1 1 ...
#>   ..$ org_pref: chr [1:838] "University of Prince Edward Island" ...
#>   ..$ org     : chr [1:838] "Univ Prince Edward Isl" ...
#>   ..$ city    : chr [1:838] "Charlottetown" ...
#>   ..$ state   : chr [1:838] "PE" ...
#>   ..$ country : chr [1:838] "Canada" ...
#>  $ author_address:'data.frame':  18 obs. of  3 variables:
#>   ..$ ut       : chr [1:18] "WOS:000208276800197" ...
#>   ..$ author_no: num [1:18] 1 2 ...
#>   ..$ addr_no  : num [1:18] 1 1 ...
#>  $ jsc           :'data.frame':  901 obs. of  2 variables:
#>   ..$ ut : chr [1:901] "WOS:000173956100001" ...
#>   ..$ jsc: chr [1:901] "Veterinary Sciences" ...
#>  $ keyword       :'data.frame':  2096 obs. of  2 variables:
#>   ..$ ut     : chr [1:2096] "WOS:000177154900014" ...
#>   ..$ keyword: chr [1:2096] "animality" ...
#>  $ keywords_plus :'data.frame':  2020 obs. of  2 variables:
#>   ..$ ut           : chr [1:2020] "WOS:000180265600060" ...
#>   ..$ keywords_plus: chr [1:2020] "housing conditions" ...
#>  $ grant         :'data.frame':  1 obs. of  3 variables:
#>   ..$ ut          : chr "WOS:000208574800048"
#>   ..$ grant_agency: chr "Selcuk University Research Foundation"
#>   ..$ grant_id    : chr "2000/062"
#>  $ doc_type      :'data.frame':  642 obs. of  2 variables:
#>   ..$ ut      : chr [1:642] "WOS:000173956100001" ...
#>   ..$ doc_type: chr [1:642] "Editorial Material" ...

InCites

# Save your InCites developer key in an environment variable
Sys.setenv(INCITES_KEY = "your_key")
# 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

# Download WoS data
wos <- pull_wos('TS = ("dog welfare")', sid = sid)

# Download InCites data
head(pull_incites(wos$publication$ut))