This is useful for functions that are "flaky", such as curl, which may fail for unknown reasons that do not persist.

retry(expr, retries = 5, silent = FALSE)

Arguments

expr

Expression to run.

retries

Numeric. The maximum number of retries.

silent

Logical indicating whether to try silently.

Details

Based on https://github.com/jennybc/googlesheets/issues/219#issuecomment-195218525.