title: Filtering a dataframe based on a value from column in R
body: <p>I have a dataframe df as shown below</p>
  
  <pre><code> sample  variant            
  1 HLA1    1,3,4,5            
  2 HLA2    1,5 
  3 HLA3    2,3
  4 HLA4 
  5 HLA5    1
  6 HLA6    1,4,3
  7 HLA7    1
  8 HLA8    4,3
  </code></pre>
  
  <p>I would like to extract all the rows with "1". For eg This is the Output I need</p>
  
  <pre><code> sample  variant            
  1 HLA1    1,3,4,5            
  2 HLA2    1,5 
  3 HLA5    1
  4 HLA6    1,4,3
  5 HLA7    1
  </code></pre>
  
  <p>So i thought this would work</p>
  
  <pre><code>CF &lt;- df[df$variant=="1"]
  </code></pre>
  
  <p>And this gave me as follows</p>
  
  <pre><code> sample  variant 
  1 HLA5    1
  2 HLA7    1
  </code></pre>
  
  <p>Can anyone help to achieve this in R. I have simplified my case here, actuality the dataframe runs to over a hundred thousand rows. Thank you</p>