ensure | R Documentation |
This function can be used to do quick checks on your code, especially in
RMarkdown analysis documents. For example, making sure that the number of
rows in a dataframe hasn't changed after a left-join operation. For more
than a handful of tests, look for a fuller testing package like assertr
.
ensure(desc, expr)
desc |
(Character) Human-readable description of the expression being evaluated. |
expr |
(Expression) The expression being tested. It should evaluate to
|
An Error if the test fails, or a Message if the test passes.
## Not run:
letters
length(letters)
ensure("There should be 26 letters", length(letters) == 26)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.