hello im trying to extract some id with a group and Date in range
> d1
id group Date
1: 1 A 2017-07-02
2: 2 A 2017-07-04
3: 3 A 2017-05-15
4: 4 A 2017-08-02
5: 5 B 2017-12-28
6: 6 B 2015-07-02
7: 7 B 2012-07-02
8: 8 B 2018-07-02
9: 9 C 2017-07-02
10: 10 C 2017-07-02
11: 11 C 2017-07-02
12: 12 C 2017-07-04
13: 13 D 2017-05-15
14: 14 D 2017-08-02
15: 15 D 2017-12-28
16: 16 D 2015-07-02
17: 17 E 2012-07-02
18: 18 E 2018-07-02
19: 19 E 2017-07-02
20: 20 E 2017-07-02
> d2
group timestamp1 timestamp2
1: A 2015-07-01 2017-07-20
2: A 2020-07-12 2017-07-15
3: B 2017-05-15 2020-05-22
and i want the id from d1 matching d2 date range and group
group timestamp1 timestamp2 id
1: A 2017-07-02 2017-07-02 1
2: A 2017-07-04 2017-07-04 2
3: A 2017-05-15 2017-05-15 3
4: B 2017-12-28 2017-12-28 5
5: B 2018-07-02 2018-07-02 8
i checked this How to perform join over date ranges using data.table? i think it's the solution but ican't make it works.
Date, timestamp, timestamp2 are in POSIXct
please help :)