title: My for loop won't run in r
body: <p>I can't get this for loop to run.</p>
  
  <pre><code>loopLength &lt;- length(vector_X)
  i &lt;- 1
  
  for (x in 1:loopLength) 
    vector_Y &lt;- Frame_X$column_a == vector_X[i]
    Frame_Y &lt;- Frame_X[Vector_Y,]
    Frame_A &lt;- Frame_Y$column_b == vector_X[i]
    Frame_Z &lt;- Frame_Y[Frame_A,]
    Vector_T &lt;- Frame_Y$column_c == Frame_Z[1,2]
    Frame_Z2 &lt;- Frame_Y[Vector_T,]
    returnSum1[i] &lt;- sum(Frame_Z2$column_d)
  
    Frame_Z3 &lt;- Frame_Y[!(Frame_Z1),]
    returnSum2[i] &lt;- sum(Frame_X3$column_d)`
  </code></pre>
  
  <p>I can run the stand_alone code block by replacing the i with an integer (it is only running from 1 to 20) and crosscheck the db and the results are correct. However, I can't seem to iterate it. </p>
  
  <p>I think I'm missing something glaring about integrating a loop but I've looked and can't seem to find it. </p>
  
  <p>It doesn't work when I try to run it as <code>for (i in 1:20)</code> either.
  Nor do the inclusion or exclusion around brackets around the code block work         either.</p>