title: Removing outliers by filtering values in R
body: <p>i have a dataframe like this :</p>
  
  <pre><code>         ds        y
  1   2015-12-31 35.59050
  2   2016-01-01 28.75111
  3   2016-01-04 25.53158
  4   2016-01-06 17.75369
  5   2016-01-07 29.01500
  6   2016-01-08 29.22663
  7   2016-01-09 29.05249
  8   2016-01-10 27.54387
  9   2016-01-11 28.05674
  10  2016-01-12 29.00901
  11  2016-01-13 31.66441
  12  2016-01-14 29.18520
  13  2016-01-15 29.79364
  14  2016-01-16 30.07852
  </code></pre>
  
  <p>i'm trying to create a loop that remove the rows which values in the <code>'ds'</code> column are above 34 or below 26, because there is where my outliers are:</p>
  
  <pre><code>for (i in grupo$y){if (i &lt; 26) {grupo$y[i] = NA}}
  </code></pre>
  
  <p>i tried this to remove those below 26, i don't get any errors, but those rows won't go.</p>
  
  <p>Any suggestions about how to remove those outliers??</p>
  
  <p>Thanks in advance</p>