Hide R code in RStudio

hello guys,

I have built few scripts that automate some tasks for different types of role in a company.
I am starting as a freelance and was thinking maybe start charging/selling these scripts.

I would like to know if there is a way to hide the R code in RStudio while still letting the ability for the user to launch the code? As I don't want my work to be easily shared to other peers.

Would someone have an idead on how to do that? Maybe with Shiny as well?
Thanks a lot.
Maxence

Create a shiny app. Upload a sample of it on shinyApps.io and send it to the client. They cant see the code and still run everything.

Once they agree to pay continue...

I have done it successfully for quite some time.

1 Like

hi @Anantadinath thanks for the feedback ! I might message you.

It's hard to do for a number of reasons.

You can, as had been discussed, roll it into a shiny app, and that may work for you, at least short term.

However, in my experience, keeping your code to yourself like that is not a long term solution to what you perceive as a problem.

First, your concerns about needing to protect your code are likely overblown. That's not to say they're completely unfounded, rather it's not as likely as you fear that your code would be shared.

Second, depending on what your code does, (you said it automates some tasks done at a company), I believe very few organizations would put this code into a production environment without having the ability to audit the code.

Third, hiding your code away isn't the correct, best, or most secure way to protect it. Contracts1 are. If you're really concerned about your code getting out, the best thing you can do is get yourself an attorney and pound out some standard contracts.

The shiny app idea is a great way to showcase your work before you have established a business relationship, and it can certainly work as a tool for delivering a service if that's your interest. But, as a long-term solution to protecting your intellectual property, I think there are better, more profession approaches you could take.

1. I am not an attorney, and more importantly, I am not your attorney. If you have legal questions get an attorney and talk to them.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.