And MAYBE also cast them to the type of x, but that is possibly more useful, even if occasionally confusing
# pak::pak("r-lib/funs")
library(funs)
# This shouldnt recycle `x`.
# We want something with the same size as `x` in the end.
x <- 1
between(x, 1:5, 1:5)
#> [1] TRUE FALSE FALSE FALSE FALSE
# Not entirely sure about this.
# Should it try to cast left/right to type of x? And fail here?
x <- 1:5
between(x, -1.5, 3.5)
#> [1] TRUE TRUE TRUE FALSE FALSE
And MAYBE also cast them to the type of
x
, but that is possibly more useful, even if occasionally confusingCreated on 2022-04-16 by the reprex package (v2.0.1)