Skip to contents

Dataverse installations each issue their own API token (unlike Zenodo/OSF, which are single services) – a token from dataverse.harvard.edu is meaningless to dataverse.nl. Tokens are therefore stored per host.

Usage

dataverse_pat(host, pat = NULL)

Arguments

host

the Dataverse installation's hostname (e.g. "dataverse.harvard.edu")

pat

the token to set, or NULL to get the current token

Value

the current token (character; "" when none is set)

Details

Create a token by signing in to the installation, opening your account page, and selecting "API Token".

Store it as an environment variable named DATAVERSE_PAT_<HOST>, with the host uppercased and every . replaced by _ (e.g. DATAVERSE_PAT_DATAVERSE_HARVARD_EDU), so it is read every time R starts.

Examples

dataverse_pat("dataverse.harvard.edu") # returns "" unless a token is set
#> [1] ""