title: how to select rows from a dataframe1 in R where dataframe$1column is found somewhere in dataframe2$column
body: <p>I need to create a new dataframe from rows from dataframe1, such that the value of dataframe1$column is a value found in dataframe2$colum</p>
  
  <p>the dataframes are:</p>
  
  <pre><code>y &lt;- "name,number,lunch  
  joe,2,peaches  
  steve,5,hotdog  
  jon,7,clamroll  
  nick,11,sloppyJoe"
  
  
  x &lt;- "number,office  
  1,1b  
  2,1a  
  3,2s  
  4,4d  
  5,f4  
  6,f4  
  7,h3  
  8,g3  
  9,j7  
  10,d3 
  11,jk"  
  
  df1 &lt;- read.csv(textConnection(df1), header=TRUE, sep=",", stringsAsFactors=FALSE)  
  df2 &lt;- read.csv(textConnection(df2), header=TRUE, sep=",", stringsAsFactors=FALSE)
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>df3 &lt;- df1[which(df1$number == df2$number), ]
  </code></pre>
  
  <p>to no avail.
  How do I properly do this in R?  I could write a perl script, but I have about 100 of these sets and don't want to create more temp files.</p>