R/init.R

#' initialize a satchel directory
#' @param .dir directory
#' @details Defaults to data/derived/satchel relative
#' to working directory
#'
#' Best if run from the console after opening an rstudio project
#' @return path to satchel directory
#' @export
init_satchel_dir <- function(.dir = "data/derived/satchel") {
    if (!dir.exists(.dir)) {
        dir.create(.dir, recursive = TRUE)
        message("satchel directory created at ", normalizePath(.dir))
    } else {
        message("satchel directory already detected at ", normalizePath(.dir))
    }
    return(.dir)
}
dpastoor/satchel documentation built on May 15, 2019, 1:23 p.m.