binregtest {regtest} | R Documentation |
This function compares to parallel implementations of the same function for equality with respect to all (defined) parameter combinations.
binregtest(FUN1, FUN2, ..., PARS = NULL, PAR1 = NULL, PAR2 = NULL, WHICH = sample(1:n), TRYALL = TRUE, COMP = is.all.equal, NAME = "UNNAMED binregtest", VERBOSE = FALSE)
FUN1 |
first function |
FUN2 |
second function |
... |
common arguments, each specified as a list |
PARS |
list of common arguments, each specified as a list, helps to use argument names that are used by binregtest itself |
PAR1 |
optional parameters only handed over to FUN1 (default NULL) |
PAR2 |
optional parameters only handed over to FUN2 (default NULL) |
WHICH |
optional integer vector defining a subset of the possible parameter combinations |
TRYALL |
FALSE to interrupt testing once an error has been found (default TRUE tests everything) |
COMP |
function to compare results (default is.all.equal ) |
NAME |
character scalar describing this regression test |
VERBOSE |
TRUE to verbose all tests (default FALSE) |
TRUE if all tests were successful, FALSE otherwise
Jens Oehlschlägel
wronglog <- function(x, base=exp(1)){ if (x>0) log(x, base=base) else NA } binregtest(wronglog, log, x=as.list(0:3), base=list(2, exp(1), 10))