 <p>Well, my recommendation would be twofold. First, just don't use factors when creating the data.frame; you can factor post-hoc if you really need them. So:</p> <pre><code>GammaShape &lt;- data.frame(Format, Shape, stringsAsFactors = FALSE) </code></pre> <p>Second: for loops are a really inefficient way to modify data.frames, because of how data.frames are stored and modified: every time you tweak a value, you're actually recreating the data.frame in its (new) format and assigning it to the old name, which is computationally expensive with big objects. While this is a very small data.frame, I'd suggest getting into the habit of operating on individual vectors wherever possible, and merging into a data.frame <em>after</em> you've finished iterating. So:</p> <pre><code>Format &lt;- c('10x2', '10x3', '10x7', '17x15', '17x7', '20x2', '20x3', '25x4', '4 column', '5 column', '7x7', 'DPS', 'FP') Shape &lt;- numeric(length(Format)) for(i in seq_along(Shape)){ Shape[i] &lt;- coef(fitdistr(modelset$ETTime[which(modelset$Format == Format[i])]/1000)) } GammaShape &lt;- data.frame(Format, Shape, stringsAsFactors = FALSE) </code></pre> <p>...and then if you want to factor, well, apply <code>as.factor</code>. Note that this solution works <em>to the best of my knowledge</em> - your example doesn't show us modelset.</p>