title: How to retry a statement on error?
body: <p>How can I simply tell R to retry a statement a few times if it errors? E.g. I was hoping to do something like:</p>
  
  <pre><code>tryCatch(dbGetQuery(...),           # Query database
      error = function(e) {
          if (is.locking.error(e))    # If database is momentarily locked
              retry(times = 3)        # retry dbGetQuery(...) 3 more times
          else {
              # Handle other errors
          }
      }
  )
  </code></pre>