Skip to content

Commit

Permalink
Tweaks inspired by copy editing the print version
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Apr 29, 2023
1 parent dd90d0a commit 0961897
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions license.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ In brief:
- If your package primarily contains data, not code, and you want minimal restrictions, choose the [CC0 license](https://choosealicense.com/licenses/cc0-1.0/) with `use_cc0_license()`.
Or if you want to require attribution when your data is used, choose the [CC BY license](https://choosealicense.com/licenses/cc-by-4.0/) by calling `use_ccby_license()`.

- If you don't want to make your code open source call `use_proprietary_license()`.
- If you don't want to make your code open source, call `use_proprietary_license()`.
Such packages can not be distributed by CRAN.

We'll come back to more details and present a few other licenses in @sec-more-licenses.
Expand Down Expand Up @@ -119,7 +119,7 @@ This is used when you have bundled code written by other people, and parts of yo

### More licenses for code {#sec-more-licenses}

I gave you the absolute minimum you need to know above.
We gave you the absolute minimum you need to know above.
But it's worth mentioning a few more important licenses roughly ordered from most permissive to least permissive:

- `use_apache_license()`: the [Apache License](https://choosealicense.com/licenses/apache-2.0/) is similar to the MIT license but it also includes an explicit patent grant.
Expand All @@ -135,8 +135,8 @@ But it's worth mentioning a few more important licenses roughly ordered from mos
Because this is a considerably broader claim than the GPL, many companies expressly forbid the use of AGPL software.

There are many other licenses available.
To get a high-level view of the open source licensing space, and the details of individual licenses, I highly recommend <https://choosealicense.com>, which I've used in the links above.
For more details about licensing R packages, I recommend [*Licensing R*](https://thinkr-open.github.io/licensing-r/) by Colin Fay.
To get a high-level view of the open source licensing space, and the details of individual licenses, we highly recommend <https://choosealicense.com>, which we've used in the links above.
For more details about licensing R packages, we recommend [*Licensing R*](https://thinkr-open.github.io/licensing-r/) by Colin Fay.
The primary downside of choosing a license not in the list above is that fewer R users will understand what it means, and it will make it harder for them to use your code.

### Licenses for data
Expand Down Expand Up @@ -182,7 +182,7 @@ This section will discuss code that others give to you, and the next section wil
When someone contributes code to your package using a pull request or similar, you can assume that the author is happy for their code to use your license.
This is explicit in the [GitHub terms of service](https://docs.github.com/en/github/site-policy/github-terms-of-service#6-contributions-under-repository-license), but is generally considered to be true regardless of how the code is contributed[^license-5].

[^license-5]: Some particularly risk averse organisations require contributors to provide a [developer certificate of origin](https://developercertificate.org), but this is relatively rare in general, and I haven't seen it in the R community.
[^license-5]: Some particularly risk averse organisations require contributors to provide a [developer certificate of origin](https://developercertificate.org), but this is relatively rare in general, and we haven't seen it in the R community.

However, the author retains copyright of their code, which means that you can't change the license without their permission (more on that shortly).
If you want to retain the ability to change the license, you need an explicit "contributor license agreement" or CLA, where the author explicitly reassigns the copyright.
Expand Down Expand Up @@ -239,24 +239,24 @@ There are five main cases to consider:

If your package isn't open source, things are more complicated.
Permissive licenses are still easy, and copyleft licenses generally don't restrict use as long as you don't distribute the package outside your company.
But this is a complex issue and opinions differ, and should check with your legal department first.
But this is a complex issue and opinions differ, and you should check with your legal department first.

### How to include {#sec-how-to-include}

Once you've determined that the licenses are compatible, you can bring the code in your package.
When doing so, you need to preserve all existing license and copyright statements, and make it as easy as possible for future readers to understand the licensing situation:

- If you're including a fragment of another project, generally best to put in its own file and ensure that file has copyright statements and license description at the top.
- If you're including a fragment of another project, it's generally best to put in its own file and ensure that file has copyright statements and license description at the top.

- If you're including multiple files, put in a directory, and put a LICENSE file in that directory.

You also need to include some standard metadata in `Authors@R`.
You should use `role = "cph"` to declare that the author is a copyright holder, with a `comment` describing what they're the author of.

If you're submitting to CRAN and the bundled code has a different (but compatible) license, you also need to include a `LICENSE.note` file that describes the overall license of the package, and the specific licenses of each individual component.
For example, the diffviewer package bundles six javascript libraries all of which use a permissive license.
For example, the diffviewer package bundles six Javascript libraries all of which use a permissive license.
The [`DESCRIPTION`](https://github.com/r-lib/diffviewer/blob/main/DESCRIPTION) lists all copyright holders, and the [`LICENSE.note`](https://github.com/r-lib/diffviewer/blob/main/LICENSE.note) describes their licenses.
(Other packages use other techniques, but I think this is the simplest approach that will fly with CRAN.)
(Other packages use other techniques, but we think this is the simplest approach that will fly with CRAN.)

## Code you use

Expand Down

0 comments on commit 0961897

Please sign in to comment.