title: R For Loop Output Into Table
body: <p>Here is a snipit of my code:</p>
  
  <pre><code>parameters$x&lt;-0
  parameters$y&lt;-0
  for (x in c(1:2)){
    for (y in c(10,20,30,40,50,60,70,80,100)){
  control &lt;- rpart.control(minsplit = x,
                           minbucket = round(y),
                           maxdepth = 10,
                           cp = 0)
  tune_fit &lt;- rpart(survived~., data = data_train, method = 'class', control = control)
  
  parameters[x] &lt;-accuracy_tune(tune_fit)
  }}
  </code></pre>
  
  <p>I basically want a table that has the <code>x</code> rows and <code>y</code> columns (based on what my <code>x</code> and <code>y</code> inputs are in the for loop) and then storing the output of the function as a value in this new table. I recognize what I am trying to do with parameters is not working. </p>