I have my original data frame from which I only want to keep certain rows.
head(original_df)
id roi mean sd
1 1102A HarvardOxford 0.4675 0.1345
2 1102A HarvardOxford 0.4456 0.1345
3 1102A HarvardOxford 0.4567 0.788
4 1102A HarvardOxford 0.1231 0.8976
5 1102A Lh_func_3 0.1231 0.8678
6 1102A Lh_func_ 0.2342 0.67856
The id-column includes the subjects code + an "A" or "B" or "C" depending on the session.
I have another df (subs) with only one variable which includes the ids I want to keep (it contains a selection of all the ids from the original df). In this data frame there is only the subjects code but no session indicator.
head(subs)
V1
1 1102
2 1103
3 1104
4 1107
5 1110
6 1111
How can I keep just the rows of my original data frame that match the subs$V1 column?