[datatable-help] between() versus %between% - why different results?

Douglas Clark clark9876 at airquality.dk
Thu Oct 10 11:34:25 CEST 2013


Thanks eddi, that clears it up for me. But it is unfortunate that %between%
does not support the full vector comparison that my problem requires.

It would be nice if %between% would allow a 2-column RHS, equivalent to
cbind(start,end) in my case. This does not work at present, because current
implementation appears to use:

dt[ x %between% cbind(start,end) ] ---> dt[ between(x, cbind(start,end)[1],
cbind(start,end)[2]) ]

which is also equivalent to dt[ between(x, start[1], start[2]) ] when
length(start) > 1

Does anyone see a problem if %between% were enhanced to allow the RHS to be
a 2-column vector?
That is, for dim(y) > 1, x %between% y  would be executed as between( x,
y[,1], y[,2] ) 

If not, I will propose it as a FR.



--
View this message in context: http://r.789695.n4.nabble.com/between-versus-between-why-different-results-tp4677718p4677962.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list