EVOLUTION-MANAGER
Edit File: try_again.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Try evaluating an expressing multiple times until it...</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for try_again {testthat}"><tr><td>try_again {testthat}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Try evaluating an expressing multiple times until it succeeds.</h2> <h3>Description</h3> <p>Try evaluating an expressing multiple times until it succeeds. </p> <h3>Usage</h3> <pre> try_again(times, code) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>times</code></td> <td> <p>Maximum number of attempts.</p> </td></tr> <tr valign="top"><td><code>code</code></td> <td> <p>Code to evaluate</p> </td></tr> </table> <h3>Examples</h3> <pre> third_try <- local({ i <- 3 function() { i <<- i - 1 if (i > 0) fail(paste0("i is ", i)) } }) try_again(3, third_try()) </pre> <hr /><div style="text-align: center;">[Package <em>testthat</em> version 3.1.5 <a href="00Index.html">Index</a>]</div> </body></html>