diff --git a/NEWS.md b/NEWS.md index 84ff106ca9..ce933e0685 100644 --- a/NEWS.md +++ b/NEWS.md @@ -73,7 +73,7 @@ 34. `%between%` is vectorised which means we can now do: `DT[x %between% list(y,z)]` which is equivalent to `DT[x >= y & x <= z]`, [#534](https://github.com/Rdatatable/data.table/issues/534). Thanks @MicheleCarriero for filing the issue and the idea. - 35. New functions `inrange()` and `%inrange%` are exported. It performs a range join making use of the recently implemented `non-equi` joins ([#1452](https://github.com/Rdatatable/data.table/issues/1452)) [#679](https://github.com/Rdatatable/data.table/issues/679). + 35. New functions `inrange()` and `%inrange%` are exported. It performs a range join making use of the recently implemented `non-equi` joins ([#1452](https://github.com/Rdatatable/data.table/issues/1452)) [#679](https://github.com/Rdatatable/data.table/issues/679). Also thanks to @DavidArenburg for [#1819](https://github.com/Rdatatable/data.table/issues/1819). 36. `rbindlist` supports columns of type `complex`, [#1659](https://github.com/Rdatatable/data.table/issues/1659). diff --git a/R/between.R b/R/between.R index fd592b06d0..306d8d9b9c 100644 --- a/R/between.R +++ b/R/between.R @@ -23,7 +23,7 @@ inrange <- function(x,lower,upper,incbounds=TRUE) { ops = if (incbounds) c(4L, 2L) else c(5L, 3L) # >=,<= and >,< ans = bmerge(shallow(subject), query, 1:2, c(1L,1L), FALSE, xo <- forderv(query), 0, c(FALSE, TRUE), 0L, "all", ops, integer(0), - 1L, FALSE) + 1L, getOption("datatable.verbose")) # fix for #1819, turn on verbose messages setDT(ans[c("starts", "lens")], key=c("starts", "lens")) .Call(Cinrange, idx <- rep(FALSE, length(x)), xo, ans[["starts"]], ans[["lens"]]) idx diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 42a6831631..c1d4ca8292 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -9135,6 +9135,14 @@ test(1695.2, x %between% c(NA, 7), c(NA, NA, NA, NA, NA, FALSE)) test(1695.3, x %between% c(3, NA), c(NA, NA, FALSE, NA, FALSE, NA)) test(1695.4, x %between% c(NA, NA), rep(NA, 6L)) +# test for #1819, verbose message for bmerge +old_opt = getOption("datatable.verbose") +options(datatable.verbose = TRUE) +x = data.table(A = 10:17) +test(1696.0, grepl("bmerge", capture.output(DT[A %inrange% 13:14])[1L]), TRUE) +# restore verbosity +options(datatable.verbose = old_opt) + ########################## # TODO: Tests involving GForce functions needs to be run with optimisation level 1 and 2, so that both functions are tested all the time.