title: Subsetting in R using OR condition with strings
body: <p>I have a data frame with about 40 columns, the second column, data[2] contains the name of the company that the rest of the row data describes. However, the names of the companies are different depending on the year (trailing 09 for 2009 data, nothing for 2010). </p>
  
  <p>I would like to be able to subset the data such that I can pull in both years at once. Here is an example of what I'm trying to do...</p>
  
  <pre><code>subset(data, data[2] == "Company Name 09" | "Company Name", drop = T) 
  </code></pre>
  
  <p>Essentially, I'm having difficulty using the OR operator within the subset function. </p>
  
  <p>However, I have tried other alternatives:</p>
  
  <pre><code>subset(data, data[[2]] == grep("Company Name", data[[2]]))
  </code></pre>
  
  <p>Perhaps there's an easier way to do it using a string function? </p>
  
  <p>Any thoughts would be appreicated.</p>