generated from r4ds/bookclub-template
-
Notifications
You must be signed in to change notification settings - Fork 18
/
12-licensing.Rmd
172 lines (123 loc) · 6.51 KB
/
12-licensing.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Licensing
**Learning objectives:**
- Choose a license for your package.
- Apply a license to your package.
- Use licensed code in your package.
## Disclaimer {-}
- **Information presented in this session is not legal advice.**
- I am not a lawyer.
- Selling package? Seek consultation from a legal professional.
## Default = copyright {-}
- If no license specified, ***no one can copy code without express permission.***
- Open source != no license/no copyright!
- Authors still own their work
- Licenses = permission to use with stated restrictions
## Who is the copyright holder? {-}
- Code written on your own time: you
- Code written under contract: you unless contract describes otherwise
- Code written on company time: your employer (probably)
- If in doubt: discuss with a legal professional
## Major license categories {-}
- `Permissive` licenses
- Can be freely copied, modified, and published.
- Only restriction: license must be preserved.
- Examples: `MIT` & `Apache`
- `Copyleft` licenses
- Can be freely copied and modified.
- If you publish, must use same license.
- Examples: `GNU GPL v3` (or v2)
- `Data` (and other content) licenses
- ⬆️ Code-specific
- `CC0` ≈ `MIT` (free to use, no restrictions)
- `CC BY` ≈ `GPL` (free to use, must attribute)
## Survey of R licenses {-}
- [`dplyr`](https://cran.r-project.org/package=dplyr): MIT
- [`lubridate`](https://cran.r-project.org/package=lubridate): GPL-2
- [`purrr`](https://cran.r-project.org/package=purrr): MIT
- [`survey`](https://cran.r-project.org/package=survey): GPL-2 | GPL-3
- [`R`](https://www.r-project.org/about.html): GPL >= 2
- [`R Studio`](https://support.rstudio.com/hc/en-us/articles/217801078-What-license-is-RStudio-available-under-): AGPL v3
- [`shiny`](https://cran.r-project.org/package=shiny): GPL-3
## By the numbers {-}
- All programming languages ([2015 Survey of GitHub repos](https://github.blog/2015-03-09-open-source-license-usage-on-github-com/)):
- ~55% permissive
- ~20% copyleft
- CRAN packages (book's analysis, 2022):
- ~70% copyleft
- ~15% permissive
## Seek further guidance {-}
- [https://chooselicense.com](https://choosealicense.com/)
- [Licensing R by Colin Fay](https://thinkr-open.github.io/licensing-r/)
- Selling? Consult a legal professional!
## Applying a license {-}
`{usethis}` functions:
- MIT: `use_mit_license()`
- GPL: `use_gpl_license()`
- CC0 (data package): `use_cc0_license()`
- CC-BY (data package, require attribution): `use_ccby_license()`
- Proprietary (non-CRAN): `use_proprietary_license()`
## Key Files {-}
- `License` field in `DESCRIPTION`
- Name + version (`GPL (>= 2)`, `Apache License (= 2.0)`)
- Standard abbreviation (`GPL-2`, `LGPL-2.1`, `Artistic-2.0`)
- Name + file (`MIT + file LICENSE`)
- Pointer to full text of non-standard license, file `LICENSE`
- `LICENSE` file:
1. Further details (copyright holder + year for `MIT`), or
2. Full text of non-standard license
- `LICENSE.md` = copy of full license text (`.Rbuildignore`d for CRAN)
## Relicensing {-}
- Changing license is complicated
- See book if this happens to you
## Code given to you {-}
- PRed code = your license, but they own copyright
- `Contributor License Agreement (CLA)` to assign copyright to you
- Good practice = be generous with thanks & attribution
## Code from websites {-}
- DSLC Slack uses `CC0` (doesn't impact your license): ![](images/12-licensing/r4ds-cc0-license.png)
- StackOverflow uses `CC BY-SA` (requires `GPL`)
- Check!
## Code you bundle: Examples {-}
- CSS or JS library (common with Shiny packages)
- Simple C or C++ library
- Small amount of R code *copied* from another package
***Opinion of authors: Code called via exported functions (Imports/Suggests) doesn't impact your license***
## Code you bundle: Giving credit {-}
- `Authors@R` field in `DESCRIPTION` (`role = "cph"`)
- `LICENSE.note` file to describe specific licenses of individual components
## License compatibility {-}
- You can add restrictions but not remove them
- If necessary: Wrap restrictive part in separate package
![](images/12-licensing/license-compatibility.png)
Picture from [Wikipedia](https://en.wikipedia.org/wiki/License_compatibility#Compatibility_of_FOSS_licenses)
## Meeting Videos {-}
### Cohort 1 {-}
`r knitr::include_url("https://www.youtube.com/embed/C_H1oQZD7m8")`
### Cohort 2 {-}
`r knitr::include_url("https://www.youtube.com/embed/8PU_KT5IpWg")`
### Cohort 3 {-}
`r knitr::include_url("https://www.youtube.com/embed/IWB1s0hDi20")`
<details>
<summary> Meeting chat log </summary>
```
00:05:51 Ryan Metcalf: Russ Hyde's new Cohort, "JavaScript for R": https://book.javascript-for-r.com/
00:10:18 Isabella Velásquez: Total Eclipse of the Heart ;D
00:10:32 Ryan Metcalf: OUTSTANDING!!!!
00:50:52 Ryan Metcalf: One of my favorite copyright battles was Google's development of the Dvorak language (for Android) which contained some levels of Java functions. When Oracle acquired Sun Microsystems in 2009, one of the first orders of business for Oracle was to go after Google for the a couple of code snippets supporting Android.
00:51:48 Ryan Metcalf: A good bit of reading, but great as a Legal use case of bridging open and closed source coding. https://www.supremecourt.gov/opinions/20pdf/18-956_d18f.pdf
#### Part 2
00:01:58 Ryan Metcalf: Fix for BlueTooth: sudo kill bluetoothd
00:04:49 Brendan Lam: https://twitter.com/lucystats/status/959504698842652672
00:04:57 Brendan Lam: How to pronounce it (supposedly)
00:05:22 Ryan Metcalf: Awesome Brendan! great thread!
00:17:32 Ryan Metcalf: https://creativecommons.org/Government
00:18:59 Ryan Metcalf: Directly related to the US: https://resources.data.gov/open-licenses/
00:24:16 Ryan Metcalf: Quick side note: I received a block due to API key. You can acquire one at: http://api.census.gov/data/key_signup.html
00:41:21 Ryan Metcalf: The Google Verse turned up this link for R as a package is GPL-2 | GPL-3. https://www.r-project.org/Licenses/#:~:text=R%20as%20a%20package%20is,to%20see%20if%20this%20applies.
00:44:14 Isabella Velásquez: ??pivot_longer every day
00:49:28 Rex Parsons: I think you're right
01:06:38 Isabella Velásquez: I learned of this add in that helps with roxygen2 tags: https://github.com/matt-dray/snorkel
01:11:24 Ryan Metcalf: S3 Reference: https://adv-r.hadley.nz/s3.html?q=S3#implicit-class
```
</details>
`r knitr::include_url("https://www.youtube.com/embed/---BWbMr5B0")`