Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile R script into standalone .exe file?

Tags:

r

Is there an easy way to compile my R script into standalone .exe file just like what matlab does?

like image 992
Joyce Avatar asked Dec 31 '12 01:12

Joyce


People also ask

Can you compile an R script?

In fact, you can take any R script and compile it into a report that includes commentary, source code, and script output. Reports can be compiled to any output format including HTML, PDF, MS Word, and Markdown. The first call to render creates an HTML document, whereas the second creates a PDF document.

What is Rscript exe?

Rscript.exe is for running an existing script (file) containing R commands. You generally invoke Rscript.exe with the name of the script.

Does compiling create an executable?

You produce executable code by compiling and linking in one step. An executable file has a filename extension of .exe. To produce executable code, you need to modify the Output Type setting in the project properties.


1 Answers

As a matter of fact there is a way to achieve solution that would meet your requirements. Have a look at the article on Deploying Desktop Apps with R on R-Bloggers. As detailed in the article, you will end up using a few more things than a single exe file.

Also I would like to draw your attention to the RGtk2 with use of the RGtk2 you could attempt to develop your own interface in R. If push comes to shove, I trust that you could pack your R code together with a portable version of R and dependencies into one installer and make and app from that, that would create an illusion of a single exe file.

In your question you asked whether it's easy to develop a standalone executable file interpreting R code. I wouldn't say it's easy. If you have a strong desire to run a R code from an application, you could do it in a simpler manner using RCaller for Java or R.NET.

like image 200
Konrad Avatar answered Sep 18 '22 15:09

Konrad