Skip to content

Instantly share code, notes, and snippets.

@kstseng
Last active March 5, 2019 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kstseng/03c4d1483dca5fb68bcc638d24ea581b to your computer and use it in GitHub Desktop.
Save kstseng/03c4d1483dca5fb68bcc638d24ea581b to your computer and use it in GitHub Desktop.
##
## R sample code for loading credential
##
library(configr)
config = read.config(file = '~/.config/credential')
## section_a
username_a = config$section_a$username
password_a = config$section_a$password
## section_b
username_b = config$section_b$username
password_b = config$section_b$password
print(sprintf('username_a: %s', username_a))
print(sprintf('password_a: %s', password_a))
print(sprintf('username_b: %s', username_b))
print(sprintf('password_b: %s', password_b))
## username_a: abc
## password_a: 123
## username_b: def
## password_b: 456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment