n_times_try | R Documentation |
Mainly suggested for web scraping when reaching a given domain in a short time leads to errors.
n_times_try(
.exp,
sleep_times = c(3, 3, 3),
otherwise = NULL,
print_message = FALSE
)
.exp |
Expression |
otherwise |
Value to return if all the tries resulted an error. |
print_message |
Should print the message (default FALSE). |
sleep_time |
Numeric vector given the seconds to wait for next try. |
v <- list("a", "B", 2) # only 3rd element can be added to another numeric
i = 0
n_times_try({
i = i + 1
v[[i]] + 3
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.