R/dir_error.R

Defines functions dir_error

#' Check that directory exists
#'
#' Checks if directory exists and errors if it doesnt.
#'
#' @param dir_check Full path of directory.
#' @return Error if directory does not exist.
#' @examples
#' \dontrun{
#' dir_error("C:/User/Project/")
#' }
#' @noRd

dir_error <- function(dir_check) {
  if (!dir.exists(dir_check)) {
    stop(paste("Directory does not exist:", dir_check))
  }
}
BoulderCodeHub/RWcheck documentation built on Sept. 19, 2020, 1:35 p.m.