Description Usage Arguments Value Note Author(s) References Examples
Wrapper for all.equal, with ability to specify expected outcome.
1 | allequal.test(target,current,expect=TRUE)
|
target |
R object |
current |
R object |
expect |
logical, expected result of all.equal(x,y) |
stop() if all.equal(x,y) != expect, else returns expect
Related materials and worked examples are available at http://wand.stanford.edu/anchors/
Jonathan Wand http://wand.stanford.edu
Wand, Jonathan; Gary King; and Olivia Lau. (2007) “Anchors: Software for Anchoring Vignettes”. Journal of Statistical Software. Forthcoming. copy at http://wand.stanford.edu/research/anchors-jss.pdf
Wand, Jonathan and Gary King. (2007) Anchoring Vignetttes in R: A (different kind of) Vignette copy at http://wand.stanford.edu/anchors/doc/anchors.pdf
1 2 3 4 5 6 7 8 | a <- c(1:5)
b <- a+1
allequal.test(a,a,expect=TRUE)
allequal.test(a,b,expect=FALSE)
## these throw stop() but here we wrap in try() for example usage
try(allequal.test(a,a,expect=FALSE))
try(allequal.test(a,b,expect=TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.