Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to compile R scripts into a binary?

I've done some research online but I haven't been able to come up with any answer. I know this has been asked at least thrice, as I've viewed those posts, linked here:

First Question
Second Question
Third Question

However, it's been 5, 7, and 9 years since those questions have been asked, and technology is obviously rapidly evolving :) I don't know much about R, and I haven't worked with it for a long time, and so I ask those of you who know better and have more experience if you know of anything that would be useful to me.

If there's nothing that exists now, how hard would it be to create? The reason I ask is that the company I work for would like to obfuscate the proprietary code before it goes out. I would have the full 40 hours a week to work on creating it, and so time and/or difficulty isn't a major concern.

Thanks!

like image 749
Alex Eastman Avatar asked Nov 07 '22 06:11

Alex Eastman


1 Answers

Found this: I'm not sure about the security, but this is definitely a deterrent and would take (I think) some fairly concentrated effort to crack. There is a byte code compiler for R based on the paper linked below. There is a method in library(compiler), which comes standard with R, that allows you to compile an R script to byte code. In the same library, you can load in the source files and use them as you'd like.

A Byte Code Compiler for R

like image 151
Alex Eastman Avatar answered Nov 15 '22 05:11

Alex Eastman