Learn R Programming

mark (version 0.8.1)

tryn: Try an expression a set number of times

Description

Try an expression a set number of times

Usage

tryn(expr, n = 10, silent = TRUE)

Value

result of expr

Arguments

expr

expression to evaluate

n

number of attempts until error

silent

whether to suppress warnings

Examples

Run this code
foo <- function() stop("I added an error")
try(tryn(n = 10, foo()))

Run the code above in your browser using DataLab