epiforecasts / scoringutils

Utilities for Scoring and Assessing Predictions
https://epiforecasts.io/scoringutils/
Other
48 stars 20 forks source link

Replace `is.logical` by `isTRUE` in the code #809

Closed nikosbosse closed 4 months ago

nikosbosse commented 5 months ago

We are often checking whether the output of a check_ function is a logical. Instead, it would be cleaner to check if the value is TRUE directly.

From the code review:

This seems a bit fragile since we wouldn't want FALSE (even though it's not supposed to pop up) to return TRUE.

test_columns_present <- function(data, columns) {
check <- check_columns_present(data, columns)
return(isTRUE(check))
}

_Originally posted by @Bisaloo in https://github.com/epiforecasts/scoringutils/pull/791#discussion_r1567237844_