title: R For Loop Append Dataframe Iterations to Empty Matrix
body: <p>I am trying to create an empty matrix and fill it with iterations of a dataframe. Using the below code:</p>
  <pre><code>df &lt;- data.frame(col1 = c(1:10), col2 = letters[1:10])
  var &lt;- seq(-.25,.25,.05)
  var &lt;- var[var != 0]
  
  output &lt;- matrix(ncol=ncol(df)+1, nrow=nrow(df)*length(var))
  
  for(i in 1:length(var)){
    output[i,] &lt;- df %&gt;% mutate(var = df$col1*var[i])
  }
  </code></pre>
  <p>With this code, I receive the following error message: incorrect number of subscripts on matrix</p>
  <p>Does anyone know what the issue could be? My desired output is for each value in col1 of df to be multiplied times each value in list var.</p>
  <p>Thank you for suggestions!</p>