R/listFileFormpathFileValid.R

Defines functions listFileFormpathFileValid

Documented in listFileFormpathFileValid

#' creates an existing files names list of a directory
#'
#' @param pathFile : string (path)
#'
#' @return TRUE or FALSE , string vector or NULL
#' @export
#'
#' @examples
#' pathFile <- "C:/Images"
#' listFileFormpathFileValid(pathFile)
#'
listFileFormpathFileValid <- function(pathFile){
  existe <- FALSE
  listFile <- NULL

  listFile <- list.files(path = pathFile)

  if (length(listFile) > 0){
    existe <- TRUE
  }else
    warning("Invalid path. Path doesn't exist or is empty folder.")


  return(list(existe, listFile))
}
DanGit01/ToImagen documentation built on May 29, 2019, 1:51 a.m.