I am analyzing a table in R that has 5 columns: name, seed, weight, priority, and rank (let's call this variable fulltable).
I have also isolated a column ('name') from another table I have using:
candidates <- othertable$name
What I would like to do now is extract all the entries from fulltable
where fulltable$name
matches any of the entries in candidates. What is important to me is to find out both:
- Which entries from candidates are present in fulltable
AND
- What the weight, priority, and rank are of those entries.
Essentially, I want to extract the full row of each spot where there is a match between the columns of the two tables.
When I use a function like intersect(fulltable$name, candidates)
, I get a character string showing me the overlap of the name column (which answers my Q1), but without the other critical information (i.e. no weight, priority, or rank information).
Any and all help is much appreciated!