title: for loop in R not producing desired output
body: <p>In R, when I input the following code in the iris dataset:</p>
  
  <pre><code>iris %&gt;% 
    filter(Petal.Width == 0.2 &amp; Species == "setosa") %&gt;% 
    dim()
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>[1] 29  5
  </code></pre>
  
  <p>I would like to loop through values where Petal.Width = 0.1, 0.2, 0.3, 0.4, 0.5 and get 5 different outputs.</p>
  
  <pre><code>list1 = list(0.1, 0.2, 0.3, 0.4, 0.5)
  for(i in list1){
    df_test &lt;- iris %&gt;% 
      filter(Petal.Width == i &amp; Species == "setosa") %&gt;% 
      dim()
  }
  df_test
  </code></pre>
  
  <p>However, the above code only returns one output:</p>
  
  <pre><code>[1] 1 5
  </code></pre>
  
  <p>Why is this happening and how can I get it to return 5 outputs instead?</p>