title: Subset multiple columns in R - more elegant code?
body: <p>I am subsetting a dataframe according to multiple criteria across several columns. I am choosing the rows in the dataframe that contain any one of several values defined in the vector "criteria" in any one of three different columns.</p>
  
  <p>I have some code that works, but wonder what other (more elegant?) ways there are to do this.  Here is what I've done:</p>
  
  <pre><code>criteria &lt;-c(1:10)
  subset1 &lt;-subset(data, data[, "Col1"] %in% criteria | data[, "Col2"]
   %in% criteria | data[, "Col3"] %in% criteria)
  </code></pre>
  
  <p>Suggestions warmly welcomed. (I am an R beginner, so very simple explanations about what you are suggesting are also warmly welcomed.) </p>