r/RStudio • u/majorcatlover • 14m ago
How to merge time columns?
I have to merge two datasets that include onsets and offsets of two events - when person A did X and when person B did y. I want to merge them on the onsets and offsets per pairs to see what they were doing at the same times.
DF1
ID | X_onset | X_offset | X_activity
001 | 120 | 135 | watering plants
001 | 137 | 143 | reading
DF2
ID | X_onset | X_offset | X_activity
001 | 139 | 150 | talking
001 | 170 | 189 | watching TV
Only the ones that temporally overlap should be in the merged dataset.