I'm new to R and trying to left join 2 sets of data based on License Plate Number and Datetime.
Data Set 1
LicensePlate DateTime
XLP1234P 09-JUN-18 02.52.40.144000000 PM
XLP2345P 18-JUL-18 11.22.46.855000000 AM
XLP3456P 18-JUL-18 11.22.46.856000000 AM
XLP4567P 18-JUL-18 11.22.46.856000000 AM
XLP5678P 18-JUL-18 11.22.46.857000000 AM
XLP6789P 18-JUL-18 11.22.46.858000000 AM
Data Set 2
LicensePlate DateTime
XLP1234P 09-JUN-18 02.55.40.144000000 PM
XLP2345P 18-JUL-18 11.30.46.855000000 AM
Basically, the dataset is recorded by 2 different sets of equipment and hence there will be a slight time difference. I would like to left join onto the first set based on license plate at an acceptable time difference of 10minutes.
left_join allows me to merge data by column value but how do i set a condition whereby the datetime is of a suitable range?