In the documentation for the between function called when using ?between, the function is described as
a shortcut for x >= left & x <= right
However, between handles NAs in a substantially different way than the quoted base R code would.
For example, if we called
we would receive an NA.
However, if we call the following
we receive FALSE as the return value.
I think that a return value of NA makes more sense than a return value of FALSE here, but, if FALSE is going to be returned, then it seems like this discrepancy with the base R code ought to be clearly documented in the help for the function.
In the documentation for the
betweenfunction called when using?between, the function is described asHowever,
betweenhandles NAs in a substantially different way than the quoted base R code would.For example, if we called
we would receive an NA.
However, if we call the following
we receive
FALSEas the return value.I think that a return value of
NAmakes more sense than a return value ofFALSEhere, but, ifFALSEis going to be returned, then it seems like this discrepancy with the base R code ought to be clearly documented in the help for the function.