I would like to join two data.table
s using the date as join.
Well , sometime i didn't have a exact match and in this case i would like to find the nearest less date. My probleme is very similar to this post about SQL : SQL Join on Nearest less than date
I know data.table
syntax is analogous to SQL but I can't to code this. What is the correct syntax?
A simplified example :
Dt1
date x
1/26/2010 - 10
1/25/2010 - 9
1/24/2010 - 9
1/22/2010 - 7
1/19/2010 - 11
Dt2
date
1/26/2010
1/23/2010
1/20/2010
output
date x
1/26/2010 - 10
1/23/2010 - 7
1/20/2010 - 11
Thank you in advance.