Description Usage Arguments Value Examples
Adverb to try calling a function n
times before giving up
1 |
.f |
Function to call. |
n |
Number of attempts to try |
timeout |
Timeout between attempts, in seconds |
silent |
Silence error messages? |
Modified version of input function
1 2 3 4 5 6 7 8 9 10 11 | rlog <- robustly(log, timeout = 0.3)
try(rlog("fail"))
## Not run:
nc_openr <- robustly(ncdf4::nc_open, n = 10, timeout = 0.5)
nc <- nc_openr(url)
# ...or just call the function directly
nc <- robustly(ncdf4::nc_open, n = 20)(url)
# Useful in `purrr` maps
many_vars <- purrr::map(varnames, robustly(ncdf4::ncvar_get), nc = nc)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.