If the function returns an error, retry it for the specified number of times, with a pause between attempts.
retry(fun, ..., .times = 3, .pause = 5)
One application of this function is to download a web resource. Since the download might fail sometimes, you may want to retry it for a few more times.
if (FALSE) { # interactive()
# read the GitHub releases info of the repo yihui/xfun
xfun::retry(xfun::github_releases, "yihui/xfun")
}