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
Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link
%between% is currently a vector scan.
Instead allow DT[J(id,DT(from,to)),...]
where the i is a data.list, from and to are equi-joined, and the range between them returned. Depends on non vectors being allowed in a data.table.
The text was updated successfully, but these errors were encountered:
From Lucas' email - here for reference as this is closely related. Refer to the email exchange with Xavier/Lucas for more info:
require(data.table)
set.seed(45L)
DT_USER<- unique(data.table(UID=1:10, UTIME=sample(10, 30, TRUE)))
DT_USER<-DT_USER[order(UID, UTIME)]
DT_TRANSACTION<- data.table(TIME=1:10, AMOUNT=sample(100, 10, TRUE))
# This is what i really want, join user and transaction,# but faster than doing the full cartesian product and cosuming less memory tooDT_USER[, DUMMY:=1]
DT_TRANSACTION[, DUMMY:=1]
DT_RESULT<- merge(DT_USER, DT_TRANSACTION, by="DUMMY",
allow.cartesian=TRUE)
DT_RESULT[, DUMMY:=NULL]
DT_RESULT<-DT_RESULT[TIME<=UTIME]
This requires a full join followed by a subset, which of course can and should be avoided! Thanks a lot Lucas.
Submitted by: Matt Dowle; Assigned to: Nobody; R-Forge link
%between% is currently a vector scan.
Instead allow DT[J(id,DT(from,to)),...]
where the i is a data.list, from and to are equi-joined, and the range between them returned. Depends on non vectors being allowed in a data.table.
The text was updated successfully, but these errors were encountered: