Learn R Programming

copernicusR (version 0.1.0)

copernicus_setup_credentials: Configure Copernicus Marine credentials

Description

Sets up Copernicus Marine Service credentials using various methods:

  1. Function parameters

  2. R session options

  3. Environment variables

  4. Interactive prompt (only in interactive sessions)

Usage

copernicus_setup_credentials(
  username = NULL,
  password = NULL,
  store_credentials = TRUE,
  prompt_if_missing = interactive()
)

Value

Invisible list with username and password (password is masked).

Arguments

username

Character. Copernicus Marine username. If NULL, tries other methods.

password

Character. Copernicus Marine password. If NULL, tries other methods.

store_credentials

Logical. Store credentials in session options? Default: TRUE.

prompt_if_missing

Logical. Prompt user for credentials if not found? Default: TRUE only in interactive sessions.

Examples

Run this code
if (FALSE) {
# Set credentials directly
copernicus_setup_credentials("username", "password")

# Set credentials and store in options
copernicus_setup_credentials("username", "password", store_credentials = TRUE)

# Try to get from environment/options
copernicus_setup_credentials()
}

Run the code above in your browser using DataLab