Readme.md

rdimensions

R client for interacting with the Dimensions Analytics API.

Inspired by the Dimcli python client.

Notes

This is a work in progress and subject to change.

Prerequisites

Access to the Dimensions Analytics API requires that you have a Dimensions account with the necessary authorization privileges.

At the current time, Dimensions offers free access to the Analytics API for scientometric researchers and research projects. To apply for free access, visit this page and click on ‘request access’. You will be required to fill in an application to request no-cost use of Dimensions.

Note that Dimensions has an agreement with the International Society for Scientometrics and Informetrics (ISSI) to provide no-cost access to all ISSI members directly.

Installation

Install the development version from Github:

# Install package
install.packages("devtools")
devtools::install_github("nicholasmfraser/rdimensions")

# Load package
library(rdimensions)

Authentication

Prior to making any queries, you must login with your Dimensions credentials. You can login using the dimensions_login() function, which takes a list of credentials (username and password) as arguments:

dimensions_login(credentials = list(
  "username" = "your_username",
  "password" = "your_password"
))

Alternatively, you can store your username and password in your .Renviron file, as follows:

dimensions_username=your_username
dimensions_password=your_password

You can then login simply with the command dimensions_login(), without manually supplying your credentials.

By default, login tokens expire after 24 hours. Should you wish to logout and remove your login token from your R session, use the function dimensions_logout();

dimensions_logout()

Queries

For interacting with the Dimensions Analytics API, rdimensions currently provides a single basic function: dimensions_query().

This function takes two arguments: query and format:

Some examples of potential queries are shown below. Note that when using dimensions_query, any quotation marks that are necessary parts of a DSL query must be escaped by placing a backwards slash before each quotation mark, e.g. "bibliometrics" becomes \"bibliometrics\".

# A basic query
dimensions_query("search publications return publications")

# By default, data is return in a list format. You may instead return data in 
# JSON format, by specifying the 'format' argument
dimensions_query("search publications return publications", format = "json")

# By default Dimensions limits results to a maximum of 20 records
# You can increase this using the 'limit' argument, up to a maximum of 1000 records
dimensions_query("search publications return publications limit 500")

# Search for other source types
dimensions_query("search grants return grants")
dimensions_query("search patents return patents")
dimensions_query("search policy_documents return policy_documents")
dimensions_query("search clinical_trials return clinical_trials")
dimensions_query("search researchers return researchers")

# Apply filters
dimensions_query("search publications where year in [2010:2015] return publications")

# Search for a specific DOI. Note that quotation marks within a query string
# must be escaped with a backslash ("\")
dimensions_query("search publications where doi = \"10.3389/frma.2018.00023\" return publications")

# Search for a keyword
dimensions_query("search publications for \"bibliometrics\" return publications")

Roadmap

Collaboration

Collaborators are extremely welcome! Please contribute here directly, or contact me at nicholasmfraser@gmail.com for more information.



nicholasmfraser/rdimensions documentation built on April 22, 2020, 2:43 p.m.