I have two tables here:
Name age ViehcleID
james 24 LD:DS1423
Lily 19 LD:DS1262
Ruby 29 LD:DS1462
Nam 52 LD:DS1993
Roy 26 LD:DA1423
table 2
ViehcleID PathID
LD:DS1423 BR438
LD:DS1423 BE428
LD:DS1262 BE556
LD:DS1262 BR672
LD:DS1993 Be526
LD:DS1423 BR527
LD:DS1993 BR529
LD:DS1462 BR557
since there are repeated values in table 2, (i.e one vihecleID
has two pathID
) I want to merge these two tables according to vehicleID
. This is my desired output:
Name age ViehcleID PathID
james 24 LD:DS1423 BR438
james 24 LD:DS1423 BR428
Lily 19 LD:DS1262 BE556
Lily 19 LD:DS1262 BR672
Ruby 29 LD:DS1462 BR557
Nam 52 LD:DS1993 BR529
Nam 52 LD:DS1993 Be526
So everything according to the VehcleID
, as long as the id appears in both table, and one VehicleID
can have several pathID
. New to R and anything would be helpful. Thank you.