Simple question: is there a way to compile R scripts to native code? If not is
there anything else that might improve speed? I'm not even sure that R
compiles internally to byte code or not. I assume it does since all modern
languages seem to do this. Maybe there's a JIT compiler? Yes, I
Nope. Most users get speed by using vectorized calculations. If you have
already identified how to get correct answers, the next step is something like
Rcpp or linking to a shared library written in your language of choice.
But seriously, vectorizing is enough for most applications, and making
Facts:
1. R does not by default compile bytecode. It uses a read-parse-eval
cycle as described in the R Language Manual.
2. However, as of 2.14.0 (anyway) there is a compiler package that
is shipped as part of the standard distribution. Written by Luke
Tierney and his graduate student minions,
Jeff Newmiller jdnewmil at dcn.davis.ca.us writes:
Nope. Most users get speed by using vectorized calculations. If you
have already identified how to get correct answers, the next step is
something like Rcpp or linking to a shared library written in your
language of choice.
But seriously,
Hi all,
I am struggling to compile a massive R code that I have written through
some years, aiming to provide automated investment strategies to my
Portfolio Managers. You may ask me why do I not rewrite the code in C or
C++; the answer is it is really massive and that will take me lots of
time.
One suggestion you have probably already considered, but: why not R CMD
BATCH the script? You can set up an executable to do that. No need to
compile the actual R code.
If you want to hide the code and/or it has interaction, you can also set it
up on a web or intranet server for them, calling the
6 matches
Mail list logo