Created
August 15, 2013 15:05
-
-
Save Ironholds/6241567 to your computer and use it in GitHub Desktop.
Dinky
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Dataframes (of strings. Glorious strings) | |
| foo <- data.frame(c("foo","qux","baz","quux"),c("baz","bar","foo","corge")) | |
| bar <- data.frame(c("foo","bar","baz"),c("baz","bar","foo")) | |
| #Retrieve the subset of foo that matches entries in bar. |
Here is a smarter solution, but you'll need to do a bit of work to recover them in a conformable format. That part was boring so I didn't do it.
Author
Yeah, that second one looks a lot like one of my proposed solutions (although I used ddply)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See here for a very kludgy solution. You're facing a general problem here, not an R problem (meaning doing multiple sub-element matching). So there will be a few solutions.