R/options.R

#' Constants for 'verissimo'
#'
#' Log level constants and the logger options.
#'
#' The logging configuration is managed by 'verissimo.options', a function
#' generated by OptionsManager within 'futile.options'.
#'
#' @name verissimo.options
#' @usage verissimo.options(..., simplify = FALSE, update = list())
#' @param ... TODO
#' @param simplify TODO
#' @param update TODO
#' @author Brian Lee Yung Rowe
#' @seealso \code{futile.options}
#' @keywords data
verissimo.options <- OptionsManager('verissimo.options', default = list(base.dir = tempdir.cache(), show.message = TRUE))

#' change base.dir for run.cache
#'
#' @param path to base directory where cache is saved
#'
#' @return
#' @export
#'
#' @examples
#' base.dir('/tmp/cache')
base.dir <- function(path = NULL) {
  if (!is.null(path))
    verissimo.options(update = list('base.dir', path))
  return(verissimo.options('base.dir'))
}

#' Show messages option in run.cache
#'
#' @param show.message boolean indicating to show messages or not
#'
#' @return
#' @export
#'
#' @examples
#' show.message(FALSE)
show.message <- function(show.message = NULL) {
  if (!is.null(show.message))
    verissimo.options(update = list('show.message', show.message))
  return(verissimo.options('show.message'))
}
averissimo/verissimo-rpackage documentation built on May 11, 2019, 4:07 p.m.