title: tryRetry function in R?
body: <p>I am looking for a tryCatch function in R that would retry n times instead of just once. One of my web request fails occasionally to return a value when the server is busy, but after one or two retries it usually works fine.</p>
  
  <p>The excellent page <a href="https://stackoverflow.com/questions/12193779/how-to-write-trycatch-in-r">How to write trycatch in R</a> does not touch on this topic. I found the function <a href="https://github.com/cpamp/Retry" rel="nofollow noreferrer">TryRetry</a> in C (orginally discussed in <a href="https://codereview.stackexchange.com/questions/129007/tryretry-try-catch-then-retry">TryRetry - Try, Catch, then Retry</a>) which accomplishes what I was looking for and I thought maybe a similar function exist in R in some package too?</p>
  
  <p>Unfortunately, I don't have the skills to abstract an R code structure from the C example. I could just recall my function in the error handling portion of the tryCatch, but somehow this seems the wrong way to go, especially once you deal with more than one retry.</p>
  
  <p>Any suggestions on how to approach a tryRetry-code structure in R would be appreciated.</p>