allequal.test {anchors}R Documentation

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

stop() if all.equal(x,y) != expect, else returns expect

Note

Related materials and worked examples are available at http://wand.stanford.edu/anchors/

Author(s)

Jonathan Wand http://wand.stanford.edu

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


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


[Package anchors version 3.0-8 Index]