Skip to contents

Writes API_USGS_PAT to the user's ~/.Renviron file and applies it immediately in the current session. The same variable is used by package dataRetrieval, so one key can be shared across both packages.

Usage

set_usgs_api_key(key)

Arguments

key

A single non-empty character string containing your API key.

Value

key, invisibly.

Details

Register for a free API key at https://api.waterdata.usgs.gov/signup/.

Examples

if (FALSE) { # \dontrun{
set_usgs_api_key("my_api_key_here")
} # }