EVOLUTION-MANAGER
Edit File: failwith.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: Fail with specified value.</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 failwith {plyr}"><tr><td>failwith {plyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Fail with specified value.</h2> <h3>Description</h3> <p>Modify a function so that it returns a default value when there is an error. </p> <h3>Usage</h3> <pre> failwith(default = NULL, f, quiet = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>default</code></td> <td> <p>default value</p> </td></tr> <tr valign="top"><td><code>f</code></td> <td> <p>function</p> </td></tr> <tr valign="top"><td><code>quiet</code></td> <td> <p>all error messages be suppressed?</p> </td></tr> </table> <h3>Value</h3> <p>a function </p> <h3>See Also</h3> <p><code><a href="try_default.html">try_default</a></code> </p> <h3>Examples</h3> <pre> f <- function(x) if (x == 1) stop("Error!") else 1 ## Not run: f(1) f(2) ## End(Not run) safef <- failwith(NULL, f) safef(1) safef(2) </pre> <hr /><div style="text-align: center;">[Package <em>plyr</em> version 1.8.7 <a href="00Index.html">Index</a>]</div> </body></html>