0

I am very new to R programming language. I am using Python from last couple of years.I am generating .pyc(compile file) from .py file. As we don't want to disclose the code that's why we generate .pyc file. Is there any way I can generate a similar compiled file in R programming language.

I have search internet but I didn't find any relevant information.

Is there any package that convert .R to compiled .R ??? How I can call that compiled .R file from cmd???

Any help???

ghj
  • 29
  • 5
  • Nope, there is no tool or utility that can convert a `.R` into a self-contained executable that can run without having `R` installed on the computer. Python has `py2exe` and similar utilities; `bash` has `shc`; R has nothing. – r2evans Apr 10 '22 at 02:04
  • then how I generate compiled R file??? – ghj Apr 10 '22 at 02:06
  • You don't. You run it interactively in RStudio, Rterm, emacs/ess, or perhaps `Rscript`. – r2evans Apr 10 '22 at 02:07
  • how I distribute my things to others in R programming language if I don't want to share R source code. – ghj Apr 10 '22 at 02:09
  • If I install R on the PC, can I run on self-contained executable(Compiled or .exe) file or not??? – ghj Apr 10 '22 at 02:12
  • 1
    R takes open source seriously. Sharing code is expected. If you do not want to share your source code, do not use R. – dcarlson Apr 10 '22 at 02:25
  • 1
    maybe relevant: https://stackoverflow.com/questions/10252065/sharing-r-functionality-with-multiple-users-without-exposing-code ; https://stackoverflow.com/questions/65905973/run-r-script-and-hide-the-actual-code-from-user – user20650 Apr 10 '22 at 02:26
  • [1/n] FYI: compiling from `.py` to `.pyc` for the sake of not disclosing the code is keeping the honest out, curious users will be able to deconstruct enough about the code to get what the gist of what is being done (ref: https://reverseengineering.stackexchange.com/questions/1701/decompiling-pyc-files). – r2evans Apr 10 '22 at 04:20
  • [3/3] The guidance given there is still relevant today: the only way to make sure that your users cannot see the R code is to provide a *service*, hosted on a computer that you control. It's not the cheapest nor the easiest, but protection of your code and intellectual property is your motivation. – r2evans Apr 10 '22 at 04:21

0 Answers0