inst/unitTests/test_getScore.R

## function to perform unit test for getScore

test_getScore <- function() {
    
    checkException(getScore(deltaRI = 20), 
                   "Both trueSpec and refSpec should be provided!")
    
    trueSpec = c(100, 200, 50)
    refSpec = c(100, 200, 50)
    
    checkEqualsNumeric(getScore(trueSpec = trueSpec, refSpec = refSpec), 1)
    
    refSpec = c(90, 210, 55)
    
    checkEqualsNumeric(getScore(trueSpec = trueSpec, refSpec = refSpec), 0.9329,
                       tolerance = 0.0001)
}

Try the SIMAT package in your browser

Any scripts or data that you put into this service are public.

SIMAT documentation built on Nov. 8, 2020, 8:27 p.m.