I have two CSV files. One stores a long list M such as
type price
A 100
B 200
C 300
D 600
...
The other list N also stores a list which correlate with M in terms of "type". But the length of list N is smaller than M For instance, it just has
type Performence
D 0.5
B 0.1
Is there a way to quickly find the subset of M which contains the type included in N. Within the context of the above example, I need the generate a sublist from M as
type price
B 200
D 600
Assuming you already have your files as datafames:
M.sub <- M[M$type %in% N$type,]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With