This fails as expected:
checkmate::check_integerish(c(2, 1), sorted = TRUE)
The mere presence of NAs is not an issue, as these continue to fail as expected:
checkmate::check_integerish(c(2, 1, NA), sorted = TRUE)checkmate::check_integerish(c(NA, 2, 1), sorted = TRUE)
BUT if the sort order violation is interrupted by NA, it remains unnoticed.
The following incorrectly returns TRUE:
checkmate::check_integerish(c(2, NA, 1), sorted = TRUE)
This fails as expected:
checkmate::check_integerish(c(2, 1), sorted = TRUE)
The mere presence of NAs is not an issue, as these continue to fail as expected:
checkmate::check_integerish(c(2, 1, NA), sorted = TRUE)
checkmate::check_integerish(c(NA, 2, 1), sorted = TRUE)
BUT if the sort order violation is interrupted by NA, it remains unnoticed. The following incorrectly returns TRUE:
checkmate::check_integerish(c(2, NA, 1), sorted = TRUE)