Learn R Programming

anchors (version 3.0-8)

allequal.test: all.equal with expected outcome test

Description

Wrapper for all.equal, with ability to specify expected outcome.

Usage

allequal.test(target,current,expect=TRUE)

Arguments

target
R object
current
R object
expect
logical, expected result of all.equal(x,y)

Value

References

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

Examples

Run this code

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))

Run the code above in your browser using DataLab