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
internal_id age name value date
<char> <num> <char> <num> <Date>
1: 01J7MGV511S3852XQNYADS8AAF 1 Alice 100 2024-08-01
2: 01J7MGV5118XVW8APQWESGHT90 2 Bob 150 2024-08-02
3: 01J7MGV511Y6F0KFT30H0XR07S 3 Charlie 200 2024-08-03
4: 01J7MGV511BEF4G7BKD3S5N7V0 4 David 250 2024-08-04
5: 01J7MGV511ENGEPZDW39JCRBYW 5 Eve 300 2024-08-05
You can see the date columns of the joined table is different than expected. Seems it is a copy of the relevant column (event_date) of right table not from the left table (date).
Highly appreciate your guidance to fix this issue.
The text was updated successfully, but these errors were encountered:
So we can get a better understanding of the issue, please provide some code to reproduce the tables as well as the code you used to make the join. If you have the objects assigned in your session, you can pass the object to the dput() function and R will print portable code which will re-create the table in a new session. Paste that here and we can take a look. Thanks!
without the dput output this still isn't reproducible, but now that I see this is a non-equi/inequality join I think I understand and this is known result of being consistent with how join columns are named in base R, which is especially confusing when performing an non-equi join (which doesn't even exist in base R).
There is a possible PR in progress is #3093, but in the meantime I suggest just making a copy of the column you want to keep and joining on that. Something like this:
Left table
Right table
Joined table
Joined_table <- left_table[right_table, on = .(date >= event_date), nomatch = 0L]
You can see the
date
columns of the joined table is different than expected. Seems it is a copy of the relevant column (event_date) of right table not from the left table (date).Highly appreciate your guidance to fix this issue.
The text was updated successfully, but these errors were encountered: