R/createDirectory.R

Defines functions createDirectory

Documented in createDirectory

#' Create a new directory
#'
#' Checks if the directory exists. If not, it is created. The function
#'   returns the directory file path.
#'
#' @param directory A filepath to a directory
#'
#' @return The filepath of the directory
#' @export
#'
createDirectory <- function(directory){
  if (!dir.exists(directory)){
    dir.create(file.path(directory))
  }
  return(directory)
}
dr-harper/HarpR documentation built on Nov. 8, 2019, 8:56 p.m.