set_key: Create a key or set a password for an existing key

Description Usage Arguments Details Value Examples

View source: R/key.R

Description

Save the password for a given system.

Usage

1
2
set_key(key, password = NULL, overwrite = c("ask", "yes", "no"),
  ring = getOption("keyring_keyring", "friend"))

Arguments

key

Character. The system for which you want to set up a password.

password

Character, to specify a password in plain text, or NULL to type it in at runtime.

overwrite

Character. Overwrite any existing password? "yes" to overwrite, "no" to fail, "ask" to prompt.

ring

Optional. Name of keyring.

Details

It is recommended to enter passwords interactively using set_key("system_name"). Users can also use set_key("system_name", "your_password") to enter passwords programmatically, but entering passwords in plain text is not recommended. Users could forget and save it as a script, and either way it will show up in their .Rhistory file.

Function includes checks for has_keyring, keyring_locked, and has_key. If the key already exists, set_key will either overwrite it, fail, or prompt you, depending on the value of overwrite.

Value

NULL (invisibly)

Examples

1
2
3
4
## Not run: 
set_key("snowflake")

## End(Not run)

BenjaminWolfe/speakfriend documentation built on Nov. 18, 2019, 5:09 a.m.