You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We probably need to do this because vec_compare() can "early exit" if it can determine the comparison value early on. This can cause some confusing errors since we normally say that incomplete rows are going to be propagated as missing rows in the result, and I think that should take precedence over the comparison.
library(ivs)
library(vctrs)
# Can determine comparison early onstart<- data_frame(x=1, y=NA)
start#> x y#> 1 1 NAend<- data_frame(x=0, y=2)
end#> x y#> 1 0 2
iv(start, end)
#> Error in `iv()`:#> ! `start` must be less than `end`.#> ℹ `start` is not less than `end` at locations: `c(1)`.#> Backtrace:#> ▆#> 1. └─ivs::iv(start, end)#> 2. └─rlang::abort(message) at ivs/R/iv.R:184:4
iv_diff(vec_c(start, end))
#> Error in `iv()` at ivs/R/diff.R:100:2:#> ! `start` must be less than `end`.#> ℹ `start` is not less than `end` at locations: `c(1)`.#> Backtrace:#> ▆#> 1. └─ivs::iv_diff(vec_c(start, end))#> 2. └─ivs::iv(start, end) at ivs/R/diff.R:100:2#> 3. └─rlang::abort(message) at ivs/R/iv.R:184:4# Can't determine comparison because of `NA`start<- data_frame(x=NA, y=3)
start#> x y#> 1 NA 3end<- data_frame(x=0, y=2)
end#> x y#> 1 0 2
iv(start, end)
#> <iv<data.frame<#> x: double#> y: double#> >>[1]>#> [1] [NA, NA)
iv_diff(vec_c(start, end))
#> <iv<data.frame<#> x: double#> y: double#> >>[1]>#> [1] [NA, NA)
then the comparison can also be made early, it looks like start < end, but it STILL doesn't matter in the end because the incompleteness check would kick in and result in a missing interval.
That means it should be clear that we want to apply this rule symmetrically, meaning that incompleteness should be done up front before any actual comparisons.
Also affects
iv_diff()
We probably need to do this because
vec_compare()
can "early exit" if it can determine the comparison value early on. This can cause some confusing errors since we normally say that incomplete rows are going to be propagated as missing rows in the result, and I think that should take precedence over the comparison.Created on 2022-10-09 with reprex v2.0.2.9000
The text was updated successfully, but these errors were encountered: