R/del.R

Defines functions config.sections.del

Documented in config.sections.del

#' Delete sections in config, just do config[sections] <- NULL
#'
#' @param config a list of config (eg. generated by read.config)
#' @param sections Sections that need to be deleted
#' @return 
#' A list of config
#' @export
#' @examples
#' config.json <- system.file('extdata', 'config.json', package = 'configr')
#' config <- read.config(config.json, file.type = 'json')
#' config <- config.sections.del(config, 'default')
config.sections.del <- function(config, sections) {
  config[sections] <- NULL
  return(config)
}

Try the configr package in your browser

Any scripts or data that you put into this service are public.

configr documentation built on July 17, 2020, 5:07 p.m.