Learn R Programming

gargle (version 0.3.0)

gargle_options: Options consulted by gargle

Description

Wrapper functions around options consulted by gargle, which provide:

  • A place to hang documentation.

  • The mechanism for setting a default.

If the built-in defaults don't suit you, set one or more of these options. Typically, this is done in the .Rprofile startup file, with code along these lines:

options(
  gargle_oauth_email = "jane@example.com",
  gargle_oauth_cache = "/path/to/folder/that/does/not/sync/to/cloud"
)

Usage

gargle_oauth_email()

gargle_oob_default()

gargle_oauth_cache()

gargle_quiet()

Arguments

<code>gargle_oauth_email</code>

gargle_oauth_email() returns the option named "gargle_oauth_email", which is undefined by default. If set, this option should be one of:

  • An actual email address corresponding to your preferred Google identity. Example:janedoe@gmail.com.

  • TRUE to allow email and OAuth token auto-discovery, if exactly one suitable token is found in the cache.

  • FALSE or NA to force the OAuth dance in the browser.

<code>gargle_oob_default</code>

gargle_oob_default() returns the option named "gargle_oob_default", defaulting to FALSE. This controls whether to prefer "out of band" authentication. This is ultimately passed to httr::init_oauth2.0() as use_oob. If FALSE (and httpuv is installed), a local webserver is used for the OAuth dance. Otherwise, user gets a URL and prompt for a validation code.

<code>gargle_oauth_cache</code>

gargle_oauth_cache() returns the option named "gargle_oauth_cache", defaulting to NA. If defined, the option must be set to a logical value or a string. TRUE means to cache using the default user-level cache file, ~/.R/gargle/gargle-oauth, FALSE means don't cache, and NA means to guess using some sensible heuristics.

<code>gargle_quiet</code>

gargle_quiet() returns the option named "gargle_quiet", which defaults to TRUE. Set this option to FALSE to see more info about gargle's activities, which can be helpful for troubleshooting.

Examples

Run this code
# NOT RUN {
gargle_oauth_email()
gargle_oob_default()
gargle_oauth_cache()
gargle_quiet()
# }

Run the code above in your browser using DataLab