I have a dataframe that consists of 3 cols:
tweet_id | response_id | time
1 2 22:10:47
2 NA 22:10:13
3 1 22:08:27
4 3 21:54:49
5 4 21:49:35
6 5 21:46:23
6 7 21:46:23
8 9 21:30:45
8 6 21:30:45
8 10 21:30:45
I want to compare tweet_id to response_id - but I want to iterate through all of tweet_id as a reference and see if response_id value is present in tweet_id. IF NOT - remove the row.
You'll notice duplicates in tweet_id and time - ideally they would be unique based on this logic.
Tried filter(tweet_id != response_tweet_id) but did not work.
Desired output:
tweet_id | response_id | time
1 2 22:10:47
3 1 22:08:27
4 3 21:54:49
5 4 21:49:35
6 5 21:46:23
8 6 21:30:45