title: How do I check the existence of a downloaded file
body: <p>I've created a R markdown file that starts by loading a file from the web. I found the cache=TRUE to be a little flaky so I want to put an if condition in to check for the downloaded file before downloading it. </p>
  
  <p><strong>Current Code - Always downloads file</strong></p>
  
  <pre><code>fileURL &lt;- "https://dl.dropbox.com/u/7710864/courseraPublic/samsungData.rda"
  setInternet2(TRUE)
  download.file(fileURL ,destfile="./data/samsungData.rda",method="auto")
  load("./data/samsungData.rda")
  </code></pre>
  
  <p><strong>Desired Code - only upload if if not already downloaded</strong></p>
  
  <pre><code> destfile="./data/samsungData.rda"    
   fileURL &lt;-
   "https://dl.dropbox.com/u/7710864/courseraPublic/samsungData.rda"   
   if (destFile doesNotExist) {
      setInternet2(TRUE)
      download.file(fileURL ,destfile,method="auto") }
      load("./data/samsungData.rda")
   }
   load(destfile)
  </code></pre>
  
  <p>What syntax will give me the condition "destFile doesNotExist"</p>