R/mkdir_p.R

Defines functions mkdir_p

Documented in mkdir_p

#' Wrapper to make a directory (and subdirectories) if necessary
#'
#' Mimics `mkdir -p` by making a directory and all subdirectories and
#' suppressing error messages if folder already exists.
#'
#' @param path Location of folder to be made
#'
#' @return None
#' @export
#'
#' @examples
#' mkdir_p('./test_directory')

mkdir_p <- function(path) {
    ## Mimics mkdir -p
    dir.create(path, showWarnings = FALSE, recursive = TRUE)
}
mkiang/narcan documentation built on Sept. 26, 2024, 7:18 a.m.