This is due to a temporary change to not compile assignments, like
your loop body, that appear within an argument. This is to work around
a bug elsewhere in R that will take some time to fix. Once that fix is
available these assignments will again be compiled.
Best,
On Fri, 27 Oct 2017, Colin Gi
Dear All,
In R 3.4.2 (Linux), the compiler seems to have regressed:
$ R --vanilla
g = function() {
N = 1e7; ans = numeric(N)
system.time({for (j in 1:N) ans[j] = 1})
}
g()
# user system elapsed
# 4.272 0.000 4.272
g1 = compiler::cmpfun(g)
g1()
# user system elapsed
# 4.232 0.004