<p>The code in the question was this:</p>
<pre><code>df = data_frame(group = as.factor(rep(1:5, each=100)),
                x = rep(seq(-3,3, length.out =100), 5),
                y=as.numeric(dnorm(x, mean=means[group]) &gt; 0.4*runif(10)))
</code></pre>
<p>In your answer you adapted it to</p>
<pre><code>df &lt;- data.frame(group = as.factor(rep(1:5, each=100)),
                 x = rep(seq(-3,3, length.out =100), 5),
                 y = as.numeric(dnorm(x, mean=means[group]) &gt; 
                       0.4*runif(10)),
                 dummy = 1) # dummy variable trick
</code></pre>
<p>, &amp; note that as well as appending <code>dummy</code>, you changed <code>data.frame</code> (from the <code>base</code> package) to <code>data_frame</code> (from the <code>tibble</code> package). This gives an error with the <code>data.table</code> function because <code>group</code> doesn't yet exist when you try use it to use it to create <code>y</code>—but doesn't with the <code>data_table</code> function, which is an alias for <code>tibble</code>. When the editor was fixing your code they presumably changed <code>data.frame</code> to <code>tibble</code> rather than back to the OP's <code>data_frame</code> because <code>data_frame</code> is now deprecated.</p>
<p>So there were good reasons for the edit in this case. But if there were someone going round replacing <code>data.frame</code>s with <code>tibbles</code> (or <em>vice versa</em>) just for the sake of it they oughtn't to be.</p>
