get_key function

Get or Set Up API Keys

Get or Set Up API Keys

Checks first to get key from your .Rprofile or .Renviron (or similar) file. If it's not found, then it suggests setting it up. Can be used to check that your key that is using is the key that you wish to be using or for guidance in setting up the keys.

get_key(service = c("DPIRD", "SILO"))

Arguments

  • service: (character) The API host, either DPIRD or SILO .

Returns

A string value with either a DPIRD Weather 2.0 API or SILO API key value.

Details

The suggestion is to use your .Renviron to set up the API keys. However, if you regularly interact with the APIs outside of using some other language you may wish to set these up in your .bashrc, .zshrc, or config.fish for cross-language use.

Examples

## Not run: get_key(service = "DPIRD") get_key(service = "SILO") ## End(Not run)

Other functions in weatherOz

Related functions from the same R package