title: match part of string in R
body: <p>I'm stuck with something that usually is pretty easily in other programming languages.</p>
  
  <p>I want to test whether a string is inside another one in R. For example I tried:</p>
  
  <pre><code>match("Diagnosi Prenatale,Esercizio Fisico", "Diagnosi Prenatale")
  pmatch("Diagnosi Prenatale,Esercizio Fisico", "Diagnosi Prenatale")
  grep("Diagnosi Prenatale,Esercizio Fisico", "Diagnosi Prenatale")
  </code></pre>
  
  <p>And none worked. To make it work I should fist split the first string with strsplit and extract the first element.</p>
  
  <p>NOTE: I'd like to do this on a vector of strings to receive a yes/no vector, so in the function I wrote should go a vector not a single string. But of course if the single string doesn't work, image a full vector of them...</p>
  
  <p>Any ideas?</p>