title: How to make grepl function specific?
body: <p>My data frame is shown as below. I need extract the data of a specific row according to the name of "geneID" column one by one. I use <code>grepl</code> function.</p>
  
  <pre><code>#Data frame:geneDf  
  geneID=c("EGFR","Her2","PTENPP","PTEN")
  patient1=c(12,23,56,23)
  patient2=c(23,34,11,6)
  patient3=c(56,44,32,45)
  patient4=c(23,64,45,23)
  geneDf=data.frame(patient1,patient2,patient3,patient4,geneID)
  
  geneDf
    patient1 patient2 patient3 patient4 geneID
  1       12       23       56       23   EGFR
  2       23       34       44       64   Her2
  3       56       11       32       45 PTENPP
  4       23        6       45       23   PTEN
  </code></pre>
  
  <p>The first three rows work well.</p>
  
  <pre><code>targetGene&lt;-subset(geneDf,grepl(geneDf$geneID[1],geneDf$geneID))
  targetGene
    patient1 patient2 patient3 patient4 geneID
  1       12       23       56       23   EGFR
  </code></pre>
  
  <p>When I extract the data of the 4th row, I get this:</p>
  
  <pre><code>targetGene&lt;-subset(geneDf,grepl(geneDf$geneID[4],geneDf$geneID))
  targetGene
    patient1 patient2 patient3 patient4 geneID
  3       56       11       32       45 PTENPP
  4       23        6       45       23   PTEN
  </code></pre>
  
  <p>It seems other data,in this case, the 3rd row of "geneID" column, which includes the content of the 4th row is picked up too. What's wrong with my command? How to make it only pick up the data of a certain row each time?</p>