# This script is run automatically when testthat::test_dir(testthat::test_path()) is called.
compileTestModels <- function(testData, testModelTypes, priors = NULL, userEstimates = NULL) {
testResultsVec <- list()
# new column added: values[["optimalPrior"]], default value == TRUE
testData$optimalPrior <- TRUE
for (i in 1:length(testModelTypes)) {
typeName <- names(testModelTypes)[i]
# set specific modelType
testData$modelType <- testModelTypes[i]
print(paste("Compiling modelType:", typeName))
startTime <- Sys.time()
testResultsVec[[typeName]] <-
try({
compileRunModel(
fruitsObj = shinyInputToClass(testData,
priors = as.list(priors),
userEstimates = as.list(userEstimates)),
progress = FALSE,
userDefinedAlphas = testData$userDefinedAlphas
)
},
silent = TRUE)
print(difftime(Sys.time(), startTime))
}
testResultsVec
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.