This is useful for automated tests (see
).
return
TRUE if all inputs return
TRUE;
otherwise indicate which inputs fail and how.
USAGE:
allTrue(...)
REQUIRED ARGUMENTS:
...
Multiple arguments, typically calls to
).
VALUE:
This returns
TRUE if all inputs are
TRUE. Otherwise
return a list whose components are the inputs which were not
TRUE.
SEE ALSO:
,
.
EXAMPLES:
# This function is useful in loop tests, to do multiple comparisons
# For example, if a file contained this expression
{ # Some tests for the output of bs
x <- 1:100
bsx <- bs(x, df=5)
allTrue(all.equal(attr(bsx, "degree"), 3),
all.equal(attr(bsx, "Boundary.knots"), c(1,100)),
all.equal(dim(bsx), c(10, 5)))
}
# Then do.test() would print a message indicating that the third
# comparison fails. (In this case the test itself is in error;
# the dimensions could be c(100,5).)