Skip to content

obarisk/configoptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

configoptions

Description

configoptions::configinit load options into R buildin options. the order of the options be loaded is determined by the sequence of cfg argument and the sequence of a directory of yamls being sorted. the val list has the higest precedence.

Usage

  • put your config file (y[a|]ml) into c("/etc/config/", "./config", "./config.yml")
  • configoptions::configinit()
  • extract by getOption
  • replace by configinit(key="value")

install

if (!require("devtools"))  install.packages("devtools")
devtools::install_github("obarisk/configoptions")

example

require(configoptions)
tryCatch({
  getOption("myconf")
}, error=function(e) {
  conditionMessage(e)
})
configinit(list(myconf="myconf"))
getOption("myconf")
configinit(cfg=system.file("extdata", "01-example.yml", package="configoptions"))
getOption("config_list")
getOption("config_int")
getOption("config_str")
getOption("myconf")

About

configoptions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published