Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 202004

Assign ID by matching conditions over different columns

$
0
0

Hi Guys I would like to assign an ID to the following dataframe. The Bus has to be the same if the arrival station matches departure station and if arrival time matches with the departure time. Does anyone has an idea how to solve this issue? Thanks in advance!

Example

I would like to have the following:

Expected outcome


Viewing all articles
Browse latest Browse all 202004

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>