title: subset a dataframe with character string R
body: <p>I am trying subset a dataframe by selecting a string condition in one of the columns of the dataframe.  This should be a simple task and I see it has been asked many times before but I am completely stuck</p>
  <p>A sample of the dataframe below</p>
  <pre><code>structure(list(Analyte = c(&quot;Fe&quot;, &quot;SiO2&quot;, &quot;Al2O3&quot;, &quot;TiO2&quot;, &quot;Zr&quot;
  ), Category = c(&quot;Certified&quot;, &quot;Certified&quot;, &quot;Certified&quot;, &quot;Certified&quot;, 
  &quot;Informational&quot;), AssignedValue = c(&quot;57.2&quot;, &quot;6.7497718955&quot;, &quot;2.8925&quot;, 
  &quot;0.146635643433333&quot;, &quot;0.00393333333333333&quot;), Uncertainty = c(&quot;0.0587455625228403&quot;, 
  &quot;0.0164487575063948&quot;, &quot;0.0114603084512766&quot;, &quot;0.00242243266797717&quot;, 
  NA), CILower = c(&quot;57.0448631590115&quot;, &quot;6.67853259277291&quot;, &quot;2.82556340328344&quot;, 
  &quot;0.141155720022072&quot;, &quot;0.00289242352888054&quot;), CIUpper = c(&quot;57.4618035076551&quot;, 
  &quot;6.83390972656042&quot;, &quot;2.93457675661656&quot;, &quot;0.152115566844594&quot;, 
  &quot;0.00497424313778613&quot;), labCV.all = c(&quot;0.515527815366847&quot;, &quot;1.64892092489221&quot;, 
  &quot;2.51730947074656&quot;, &quot;5.4795936391998&quot;, &quot;22.5584788355489&quot;), totalSamples = c(&quot;65&quot;, 
  &quot;65&quot;, &quot;65&quot;, &quot;65&quot;, &quot;36&quot;), NoLabs = c(&quot;10&quot;, &quot;10&quot;, &quot;10&quot;, &quot;10&quot;, &quot;5&quot;
  ), Sy = c(&quot;0.291421208884417&quot;, &quot;0.108601127975891&quot;, &quot;0.0761950799826298&quot;, 
  &quot;0.00766040470920629&quot;, NA), Uchar = c(&quot;0.0921554778554455&quot;, &quot;0.0343426920867249&quot;, 
  &quot;0.0240949999243813&quot;, &quot;0.00242243266797717&quot;, &quot;0.0003749073959734&quot;
  )), row.names = c(1L, 2L, 3L, 4L, 24L), class = &quot;data.frame&quot;)
  
  </code></pre>
  <p>I have tried the following</p>
  <pre><code>df2 &lt;- df[df$Category == &quot;Certified&quot;]
  
  </code></pre>
  <p>However the new dataframe df2 is the same as the old.</p>
  <p>I think it has something to do with the fact that dataframe is derived from a list of dataframes that was cbind together and the sturcture is not quite right?</p>
  <p>when I check the data type typeof(df) I get list</p>
  <p>I have tried many different ways to convert to a dataframe but it has made no difference.</p>