Skip to content

Can we generate exe file using R? What is the maximum file size valid?

6 messages · Chessxm, cls59, Uwe Ligges +2 more

#
Chessxm wrote:
It sounds as though you are looking for something similar to Matlab's mcc
compiler that allows Matlab code to be compiled and run independently from
the program by translating a script into C code.

To my knowledge there are only two projects that have attempted something
similar and both never progressed much past the experimental phase. The
first was called Scompile and was created by a fellow named Matt Calder. The
project has been defunct for a long time, but you might find some info at:

http://www.stat.cmu.edu/~hseltman/Scompile.html

Another recent project is r2c hosted at http://www.rforge.net . Both of
these programs are extremely limited in the types of scripts they can
convert and are probably wouldn't provide workable solution for a set of
general R scripts.

Your best shot at portability is probably to pack your code and/or data up
into an R package- that way it can be easily loaded on to any computer which
has R installed. Creating a package from an existing collection of R scripts
and data objects is very, very easy- see ?package.skeleton() and the
"Writing R Extensions" manual for starting points.
Chessxm wrote:
The problem here is that R likes to store all of it's variables in local
RAM- allocating a data frame for 300+ gigabytes worth of information is
likely to exceed your machine capacity. Many good workarounds exist for
this- most of them function by storing the variable in a database file and
only loading and accessing the parts that are needed at a given moment.

See the package "filehash" for an example of how to do this.

Hope this helps!

-Charlie


-----
Charlie Sharpsteen
Undergraduate
Environmental Resources Engineering
Humboldt State University
#
Chessxm wrote:
No, there is no compiler for R.
No. You won't find many machines around that support more than 400 Gb 
for a single process.

Uwe Ligges
6 days later
#
There are two distinct and orthogonal questions here:

1) Is it possible to package an R program/system in such a way that it
can be distributed as a single executable file (including the R
system, any necessary loaded packages, plus the application program)
and run without an installation of R (which sets up library
directories etc.)?

2) Is it possible to compile R to bytecodes or machine language?

The answers to these questions are independent.  It is perfectly
possible to have an interpreted system which is distributed as a
single executable file (using e.g. unexec to save the fully-loaded
state).  It is also perfectly possible to have a compiled system which
requires configuration of library directories etc.

I believe the original question on this thread was about (1), but I am
not certain.  It also appears that the answer to (1) is 'no', but I am
not certain about that either.  I wouldn't think that it would be
impossible to add 'unexec' to R, but I don't know R's internals.

           -s
On Wed, May 13, 2009 at 4:17 PM, Matthew Dowle <mdowle at mdowle.plus.com> wrote: