R is licensed under the GNU General Public License (GPL). I've never really understood what is allowed with the GPL, so hopefully someone here can explain it.

Is it allowed to create a web-based interface to R? It would run on a server somewhere, and users would connect via the web, and be able to run functions on data they upload. R would run on the server as a pre-compiled binary and the source code would not be modified at all.

Is this allowed under the GPL? Does it make a difference if it is free or paid?

asked 01 May '12, 22:38

DC%20Woods's gravatar image

DC Woods ♦
accept rate: 5%

GPLv2 and GPLv3 are quite different, and this is one area that might be affected. Can you say which GPL is relevant here?

(01 May '12, 22:51) Matthew Salt... ♦

It looks like a mix of GPLv2 and GPLv3: http://www.r-project.org/Licenses/

(02 May '12, 03:32) DC Woods ♦
(02 May '12, 05:35) Renaud

The final arbiter of this question is the courts, should anyone decide that they want to contest your decision. The next best source is a real intellectual property lawyer--none of us posting here are that, so the advice you get here is worth precisely what you paid for it.

Having said that, I've spent a fair amount of time around open-source licenses and my understanding about the GPL is this (expressed rather informally):

  1. If you are interacting with R through its standard user interface, you do not need to worry about compatible licensing of the code that is doing the interacting.
  2. If you are incorporating R as a callable library in your code, your code must be licensed using a license compatible with GPL--if you distribute your code. If you don't distribute it, licensing is irrelevant.
  3. If you do not distribute your code, you do not need to make source available. Running your code on a server and making a user interface available to the public does not constitute distribution. (The Afero GPL would require you to release source for your code in this case, if you used AGPL code in it. But see item 1.)
  4. You can charge for your service irrespective of whether you release source code. If you release code under an open-source license, of course, others can redistribute it as well, and can use it to offer competing services.
  5. (Added in response to Geoffrey's comment.) You can charge for your code, but if your code is licensed under the GPL, you have to release source to anyone who receives your code. You don't have to make your source public, but of course, recipients can modify and redistribute it.

answered 03 May '12, 16:00

Matthew%20Saltzman's gravatar image

Matthew Salt... ♦
accept rate: 17%

edited 03 May '12, 16:32

Good, clear summary. The distinction between 1) and 2) is important. And the distinctinon between selling your service and selling your software: the latter implies distributing your software.

(03 May '12, 16:07) Geoffrey De ... ♦

R-FAQ: Can I use R for commercial purposes?

"R is released under the GNU General Public License (GPL) version 2. If you have any questions regarding the legality of using R in any particular situation you should bring it up with your legal counsel. We are in no position to offer legal advice.

It is the opinion of the R Core Team that one can use R for commercial purposes (e.g., in business or in consulting). The GPL, like all Open Source licenses, permits all and any use of the package. It only restricts distribution of R or of other programs containing code from R. This is made clear in clause 6 (“No Discrimination Against Fields of Endeavor”) of the Open Source Definition:

The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.

It is also explicitly stated in clause 0 of the GPL, which says in part

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program.

Most add-on packages, including all recommended ones, also explicitly allow commercial use in this way. A few packages are restricted to “non-commercial use”; you should contact the author to clarify whether these may be used or seek the advice of your legal counsel.

None of the discussion in this section constitutes legal advice. The R Core Team does not provide legal advice under any circumstances."


answered 02 May '12, 05:35

fbahr's gravatar image

fbahr ♦
accept rate: 13%

edited 07 May '12, 12:17

I find the above FAQ of R's website very misleading. It doesn't explain the viral impact of GPL when distributing other programs containing code from R, that your code must be GPL too. They might not have any intent to enforce that in court (as this FAQ seems to indicate) but in that case they chose the wrong OS license (in that case they should have opted for LGPL probably?).

(08 May '12, 03:17) Geoffrey De ... ♦

@Geoffrey: The answer above addresses the question whether R can be used for commercial purposes (or be made part of commercial solutions [in terms of a "black box"] by leveraging standard I/O functions), not whether you're allowed take parts of R's sources and redistribute them [stand-alone or as part of another application] under a "non-free" license (no you aren't, of course).

(08 May '12, 05:18) fbahr ♦

@fbahr Yes, but I would argue that the common commercial software practice involves redistributing the software under a proprietary license.

Update: fbhar's output link clarifies what I originally considered misleading.

(08 May '12, 05:21) Geoffrey De ... ♦

@Geoffrey: Actually, I think that the answer is very clear on that: if you want to run R as part of a solution provided for a specific organization's "needs" [including: providing a commercial service to third parties] - and don't employ packages that are restricted to "non-commercial use" -, you're fine [as a consultant: bill your work time, not the software]; if you like to distribute (sell) R as part of another software solution, contact your legal council.

[But, again, that's what _I_ read ...and, also again, IANAL.]

(08 May '12, 06:01) fbahr ♦

Thanks for finding this. The bit I would be worried about for a web service providing access to R functions is "the output from the Program is covered only if its contents constitute a work based on the Program." It could be argued that the output from the R instance running on the server constitutes a "work based on the program". But then this would apply to any IDE, and there are non-GPL R IDEs, aren't there?

(08 May '12, 06:38) DC Woods ♦

@DC Woods: The GNU FAQ [link included above] says (section #WhatCaseIsOutputGPL): "In what cases is the output of a GPL program covered by the GPL too? - Only when the program copies part of itself into the output."

(08 May '12, 06:58) fbahr ♦

@fbahr brilliant, thanks! I guess I should RTFM.

(08 May '12, 07:00) DC Woods ♦
showing 5 of 7 show 2 more comments

IIRC, yes, it's allowed to:

  • to make that webservice paid

As long as:

  • You share the source code with the owner of that webservice (= yourself).
  • You license your code under GPL to yourself. If you then set a distribution fee of infinity $ from yourself to an outsider for even 1 copy, no copy can get out legally. This makes your code in practice proprietary while licensed as GPL :)
  • If the copy does get out 1 time legally, it would be legal to copy a million times. So that means you can't distribute/sell/sublicense your copy to anyone. Ever.

So if in any use case, you don't own the webservice, you're stuck - locked in on that GPL code and having to replace all of it and your integration code (= vendor lock-in like in non OS software). So using GPL open source software can be considered a liability in many business scenario's. Prefer ASL, LGPL, BSD or MIT open source software instead.

The FSF invented AGPL to close to the loophole in GPL (as described above) - but very few GPL projects switched to AGPL. I am not sure how GPL 3 factors into this.

Note: IANAL of course.


answered 02 May '12, 08:30

Geoffrey%20De%20Smet's gravatar image

Geoffrey De ... ♦
accept rate: 6%

edited 02 May '12, 11:23

Note: you can also make the webservice paid, and share your code as GPL (on github for example). The idea is that your brand and your know-how allows you to compete with anyone who'd take your code and set up a competitive webservice. Or you could even sell support to other people setting up your code as a webservice (not all will buy that support, but there are many companies out there that only use supported software). Look into open source business models if you're considering going that way.

(02 May '12, 08:36) Geoffrey De ... ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 01 May '12, 22:38

Seen: 6,053 times

Last updated: 08 May '12, 07:35

OR-Exchange! Your site for questions, answers, and announcements about operations research.