EVOLUTION-MANAGER
Edit File: validate_that.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: Validate that certain conditions are true.</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 validate_that {assertthat}"><tr><td>validate_that {assertthat}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Validate that certain conditions are true.</h2> <h3>Description</h3> <p><code>validate_that</code> is an alternative to the function <code><a href="assert_that.html">assert_that</a></code>, that returns a <code>character</code> vector. This makes them easier to use within S4 <code>"validate"</code> methods. </p> <h3>Usage</h3> <pre> validate_that(..., env = parent.frame(), msg = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>unnamed expressions that describe the conditions to be tested. Rather than combining expressions with <code>&&</code>, separate them by commas so that better error messages can be generated.</p> </td></tr> <tr valign="top"><td><code>env</code></td> <td> <p>(advanced use only) the environment in which to evaluate the assertions.</p> </td></tr> <tr valign="top"><td><code>msg</code></td> <td> <p>a custom error message to be printed if one of the conditions is false.</p> </td></tr> </table> <h3>Value</h3> <p>A <code>character</code> vector if the assertion is false, or <code>TRUE</code> if the assertion is true. </p> <h3>See Also</h3> <p><code><a href="assert_that.html">assert_that</a></code>, which returns an error if the condition is false. </p> <h3>Examples</h3> <pre> x <- 1 # assert_that() generates errors, so can't be usefully run in # examples validate_that(is.numeric(x)) validate_that(is.character(x)) validate_that(length(x) == 3) validate_that(is.dir("asdf")) </pre> <hr /><div style="text-align: center;">[Package <em>assertthat</em> version 0.2.1 <a href="00Index.html">Index</a>]</div> </body></html>