title: Pattern matching using a wildcard
body: <p>How do I identify a string using a wildcard?</p>
  
  <p>I've found <code>glob2rx</code>, but I don't quite understand how to use it. I tried using the following code to pick the rows of the data frame that begin with the word <code>blue</code>:</p>
  
  <pre><code># make data frame
  a &lt;- data.frame( x =  c('red','blue1','blue2', 'red2'))
  
  # 1
  result &lt;- subset(a, x == glob2rx("blue*") )
  
  # 2
  test = ls(pattern = glob2rx("blue*"))
  result2 &lt;- subset(a, x == test )
  
  # 3
  result3 &lt;- subset(a, x == pattern("blue*") )
  </code></pre>
  
  <p>However, neither of these worked. I'm not sure if I should be using a different function to try and do this.</p>