I guess this is a simple question but I would like to do the following sqldf code using data.table to do it much faster :
data2=sqldf("select a.*, b.*
from data as a inner join data_others as b
on a.cle = b.cle and a.date_1 >= b.date_2")
I've tried the following code without success :
data2=data[data_others ,on=.(CLE=CLE,DATE_1 >= DATE_2),nomatch=NULL]
This code produces almost the results I want, but i also want to keep column "DATE_2" and globally all the columns present in data_others but not in data, and avoid columns with names starting with "i.".
I guess there is an easy way to do it but I'm not enough familiar with data.table package.
Thanks in advance!