Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>My answer is a bit late, but I believe this is a good question. Unfortunately, I don't believe that there is a solution, or at least an easy one, at the present time.</p> <p>The difficulty is common because, for most interpreted languages, including R, it is often possible to turn on logging and inspection of all commands being run. This can negate many tricks to obfuscate the code.</p> <p>For those who prefer to think of code being open == good, one should know that a common reason to obfuscate the code is if one is consulting with a client that hires multiple vendors. It is not uncommon for a client to take scripts from vendor A and ask vendor B why it doesn't work with their system. (This may be done by a low-level IT flunkie, rather than someone responsible for the NDA contracts.) If A &amp; B are competitors, A's code has just been handed to B. When scripts == serious programs, then serious code has been given away.</p> <p>The ways I've seen this addressed are:</p> <ol> <li>Make a call to a compiled language, and use standard protections available there.</li> <li>Host the executable on a different server, and use calls to the server to execute the calculations. (In R, there are multiple server-side options.)</li> <li>Use compiled (preprocessed / bytecode) code within the language.</li> </ol> <p>Option 2 is actually easier and better when the code may be widely distributed, not just for IP reasons. A major advantage is that it lets you upgrade the code without having to go through the pain of a site-wide release process. If new libraries are needed, no problem - update the server.</p> <p>Option 3 is done in Matlab with <code>.p</code> files, and can be done with <code>py2exe</code> for Python on Windows. In R, the new bytecode compilation <em>may</em> be analogous, but I am not familiar enough with it to address any differences between <code>.Rc</code> files in the R context and <code>.p</code> files in the Matlab context. For more info on the compiler, see: <a href="http://www.inside-r.org/r-doc/compiler/compile" rel="noreferrer">http://www.inside-r.org/r-doc/compiler/compile</a></p> <p>Hosting computations on the server is great for working with unsophisticated users, because it is easier to iterate quickly in response to bugs or feature requests. The IP protection is simply a benefit.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload