here's a funny one. i had
is_increasing <- function(xs) {
# [...]
is_not_strictly_decreasing && is_increasing_somewhere
}
is_decreasing <- function(xs) {
is_increasing(rev(xs))
}
is_decreasing(c(1, 2, NA))
#> [1] FALSE
is_decreasing(c(NA, 2, 1))
#> [1] NA
7 days ago