R/folder.test.R

Defines functions valid.folder.path valid.file.path

valid.folder.path <-
  function(file_path){
    if(is.null(file_path)){
      # No folder specified
      return(FALSE)
    }
    if(!dir.exists(file_path)){
      # Folder does not exist
      return(FALSE)
    }
    return(TRUE)
  }

valid.file.path <-
  function(file_path){
    if(is.null(file_path)){
      # No file specified
      return(FALSE)
    }
    if(!file.exists(file_path)){
      # File does not exist
      return(FALSE)
    }
    return(TRUE)
  }

Try the activPAL package in your browser

Any scripts or data that you put into this service are public.

activPAL documentation built on July 18, 2019, 5:03 p.m.