So I have a dataframe as such
ID Date TIME var Data misc
1 1/3/2018 3:30 AM a string1 string1
1 4/23/2019 1:32 PM b string2 string1
1 1/3/2018 4:53 PM c string3 string1
2 1/4/2018 3:32 AM d string4 string2
2 3/3/2018 3:30 PM s string5 string2
2 3/3/2018 3:30 PM e string6 string2
3 4/23/2019 6:24 AM w
3 4/23/2019 1:32 PM s
3 4/24/2019 3:20 PM s
3 4/24/2019 3:20 PM a
There are a number of columns similar to Data and misc which I would like to join to fill in the df, using another df comprised of ID = 3 data.
ID3_data
DATE Time Data misc
4/23/2019 6:24 AM string7 stringA
4/23/2019 1:32 PM string8 stringB
4/24/2019 3:20 PM string9 stringC
4/24/2019 3:20 PM string10 stringC
So how could I left join my DF with this ID3_data for just the rows where ID =3?
Additionally, there is another issue where the only identifier I have is the Date and TIME but I do have different matches with the same identifiers, is there a way to say the first instance goes to the first and second the second??? So in short the final DF should look as such:
ID Date TIME var Data misc
1 1/3/2018 3:30 AM a string1 string1
1 4/23/2019 1:32 PM b string2 string1
1 1/3/2018 4:53 PM c string3 string1
2 1/4/2018 3:32 AM d string4 string2
2 3/3/2018 3:30 PM s string5 string2
2 3/3/2018 3:30 PM e string6 string2
3 4/23/2019 6:24 AM w string7 stringA
3 4/23/2019 1:32 PM s string8 stringB
3 4/24/2019 3:20 PM s string9 stringC
3 4/24/2019 3:20 PM a string10 stringC
Again, the priority is joining select rows but if the duplicate issue could also be done in the same swoop using dplyr that would be great.