I've been playing with passing arguments to .C(), and found that replacing
    as.double(x)
with
    if(is.double(x)) x else as.double(x)
saves time and avoids one copy, in the case that x is already double.

I suggest modifying as.double to avoid the extra copy and just
return x, when x is already double. Similarly for as.integer, etc.

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to