R/workspace.R

Defines functions workspace

Documented in workspace

#' Show your workspace contents
#'
#' @param silent Whether to be chatty or silent.
#'
#' @return The workspace contents.
#' @export
#'
#' @examples justifier::clean_workspace(force = TRUE, silent=FALSE);
#' justifier::log_decision(
#'   "First we start using `justifier`.",
#'   silent=FALSE
#' );
#' justifier::log_decision(
#'   paste0("Then we start documenting our ",
#'          "decisions and justifications."),
#'   silent=FALSE
#' );
#' justifier::log_decision(
#'   "Then we start learning from ourselves.",
#'   silent=FALSE
#' );
#' justifier::workspace();
workspace <- function(silent=justifier::opts$get('silent')) {

  res <-
    getOption(justifier::opts$get('workspace'),
              NULL);

  if (is.null(res)) {
    cat("Your workspace is empty!");
    return(invisible(NULL));
  }

  return(res);

}

Try the justifier package in your browser

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

justifier documentation built on March 7, 2023, 6:59 p.m.