getkey: Function to get API key.

Description Usage Arguments Details Tropicos EOL IUCN NCBI Entrez Examples

View source: R/getkey.R

Description

Checks first to get key from your .Rprofile or .Renviron (or similar) file. See Details.

Usage

1
getkey(x = NULL, service)

Arguments

x

(character) An API key, defaults to NULL

service

(character) The API data provider, used to match to default guest key (for Tropicos and EOL; there's no guest key for NCBI or IUCN, for which you have to get your own)

Details

Save your API keys with the following names:

as R options in your .Rprofile file, or

as environment variables in either your .Renviron file or .bash_profile file, or .zshrc file (if you use oh-my-zsh) or similar. See Startup for help on R options and environment variables.

Remember to restart your R session (and to start a new shell window/tab if you're using the shell) to take advantage of the new R options or environment variables.

We strongly recommend using environment variables over R options.

Note that NCBI Entrez doesn't require that you use an API key, but you should get higher rate limit with a key, so do get one.

Tropicos

Get an API key at http://services.tropicos.org/help?requestkey

EOL

EOL requires an API key. You can pass in your EOL api key in the function call like sci2comm('Helianthus annuus', key="<your eol api key>"). You can also store your EOL API key in your .Rprofile file as options(EOL_KEY = "<your eol api key>"), or just for the current session by running options(EOL_KEY = "<your eol api key>") in the console.

IUCN

IUCN requires an API key. See rredlist-package for help on authentiating with IUCN Redlist, and http://apiv3.iucnredlist.org/api/v3/token for requesting a key

NCBI Entrez

From NCBI's docs: "E-utils users are allowed 3 requests/second without an API key. Create an API key (in your account at https://www.ncbi.nlm.nih.gov/account/) to increase your e-utils limit to 10 requests/second. Contact our help department ([email protected]) if you need higher throughput. Only one API Key per user. Replacing or deleting will inactivate the current key. Refer to documentation (https://www.ncbi.nlm.nih.gov/books/NBK25497/) for more."

Examples

1
2
3
4
5
6
7
## Not run: 
getkey(service="tropicos")
getkey(service="eol")
getkey(service="iucn")
getkey(service="entrez")

## End(Not run)

taxize documentation built on March 21, 2018, 1:04 a.m.