title: Issue using try within R to catch errors with importing files
body: <p>I have a process in R in which I am importing a number of files in R. </p>
  
  <p>Occasionally there are issues with some of the files, for example there isn't an EOF character present in the file that I'm reading in, so the read.table statement errors.</p>
  
  <p>As there are a lot of files to process this is difficult to manage manually, so I would like to use some error trapping to alter the user of the issue and carry on with the other files. </p>
  
  <p>I have tried using <code>try</code> and referenced the SOF post <a href="https://stackoverflow.com/questions/31214361/what-is-the-r-equivalent-for-excel-iferror" title="What is the R equivalent for Excel IFERROR?">What is the R equivalent for Excel IFERROR?</a></p>
  
  <p>Below I would like to test the import then depending on the result either give some message to the user or actually import the file. </p>
  
  <pre><code>  mtry &lt;- try(read.table("~/file_location/test_file.csv", 
                          fill = TRUE,
                          stringsAsFactors = FALSE))
  
  
    if (!inherits(mtry, "try-error")) {
  
      read.table("~/file_location/test_file..csv", 
                 fill = TRUE,
                 stringsAsFactors = FALSE)
  
    } else {
  
      message("File doesn't exist, please check")
  
    }
  </code></pre>
  
  <p>The issue is that the <code>try()</code> statement is producing an error in the log which is what I'm trying to avoid.</p>
  
  <p>Thanks</p>