allequal.test: all.equal with expected outcome test

Description Usage Arguments Value Note Author(s) References Examples

Description

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

Usage

1
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

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

anchors documentation built on May 2, 2019, 6:59 a.m.