Description Usage Arguments See Also Examples
Run single test under given location
1 2 | ddtRunSingle(ddtDir, preload, compare, expectedFileName = "data.txt",
readSaveObj = NULL)
|
ddtDir |
(characters) path where tests inputs and outputs should be stored |
preload |
(function) loading function |
compare |
(function) compared of actual and expected objects |
expectedFileName |
(character) generated file |
readSaveObj |
(list of functions ) |
Other ddtRun: ddtRun
1 2 3 4 5 6 7 8 9 10 11 | ddtDir <- './tests/example_in_doc/testCase_1' #location where single DDT is
x <- 1:20
y <- x*2 + rnorm(20)
preload <- function(){ return(lm(y~x)) }
compare <- function(expected, actual){
if(all(abs(expected$coefficients - actual$coefficients) < 0.001) ){
print("Same")
} else {
stop("wrong coefficents. Expected ", expected$coefficients, " but is ", actual$coefficients)
}}
# ddtRunSingle(ddtDir, preload, compare) # will create required files
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.