Closed ohjakobsen closed 1 year ago
The error actually happens in the Benchmarking package and is probably due to a change in how R validates if-statements. The workaround for this is to wrap the slack function in a tryCatch
and return NULL
if the function fails with a warning or error, like this:
dea.slack <- reactive({
x <- tryCatch({
Benchmarking::slack(dea.in(), dea.out(), dea.prod())
}, warning = function(e) {
NULL
}, error = function(e) {
NULL
})
x
})
In some circumstances, the function
dea.slack
can return a null-value. This will break the app with the error messageError in if: missing value where TRUE/FALSE needed?
. The bug is not reproducible for all files, so a fix can be difficult to find. A more simple approach would be to catch a null-value and prompt the user with a warning that slack values could not be estimated.