allequal.test {anchors} | R Documentation |
Wrapper for all.equal, with ability to specify expected outcome.
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
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))