Skip to content

Commit 2b83c19

Browse files
Merge pull request #7 from openstatsware/edits-publication
Edits to publication slides
2 parents c8c8390 + f5842c0 commit 2b83c19

File tree

3 files changed

+56
-47
lines changed

3 files changed

+56
-47
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Depends:
88
emoji,
99
knitr,
1010
testthat,
11-
checkmate
11+
checkmate,
12+
rhub

slides/05_publication.qmd

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -25,36 +25,17 @@ image: thumbnails/publish.jpg
2525

2626
## Example `_pkgdown.yml` File
2727

28-
```yaml
29-
---
30-
url: https://openpharma.github.io/mmrm/latest-tag
31-
32-
template:
33-
bootstrap: 5
34-
params:
35-
ganalytics: UA-125641273-1
36-
37-
navbar:
38-
right:
39-
- icon: fa-github
40-
href: https://github.com/openpharma/mmrm
41-
42-
reference:
43-
- title: Package
44-
contents:
45-
- mmrm-package
46-
- title: Functions
47-
contents:
48-
- mmrm
49-
- fit_mmrm
50-
- mmrm_control
51-
- fit_single_optimizer
52-
- refit_multiple_optimizers
53-
- df_1d
54-
- df_md
55-
- component
28+
```{r}
29+
#| output: asis
30+
#| echo: false
31+
file <- readLines(con = "https://raw.githubusercontent.com/openpharma/mmrm/refs/heads/main/_pkgdown.yml")
32+
cat("```yaml \n---\n")
33+
writeLines(file[-1])
34+
cat("\n---\n```")
5635
```
5736

37+
Source: the [`mmrm`](https://github.com/openpharma/mmrm/blob/main/_pkgdown.yml) package documentation
38+
5839
## {background-iframe="https://openpharma.github.io/mmrm/latest-tag/reference/index.html" background-interactive="true"}
5940

6041
## Publication as GitHub Page
@@ -69,14 +50,15 @@ reference:
6950

7051
## {background-iframe="https://openpharma.github.io/mmrm/latest-tag/" background-interactive="true"}
7152

72-
# Licensing, Open sourcing, Versioning
53+
# Licensing, Open Sourcing, Versioning
7354

7455
## Licensing
7556

7657
- High level categorization of licenses:
7758
- "Permissive": Relaxed. Can be freely copied, modified, published (under the
7859
same license).
7960
- "Copyleft": Stricter. Same rights need to be preserved in derivative works.
61+
- Helpful tool: <https://choosealicense.com/>
8062
- R itself is licensed under GPL, but packages can choose, e.g.:
8163
- `usethis::use_mit_license()` for permissive MIT
8264
- `usethis::use_gpl_license()` for copyleft GPL
@@ -91,12 +73,19 @@ reference:
9173
- e.g. cannot copy/paste code from a GPL package and publish in an MIT package
9274
- `LICENSE` file optionally can contain further restrictions of the license
9375

76+
## Licensing (cont'd)
77+
78+
- You don't have to include a license with your code
79+
- But: if no license is included, your work is under your exclusive copyright by default
80+
- This means that nobody else can copy, distribute, modify it
81+
- Once the work has other contributors (each being a copyright holder for their contributions), that _nobody_ starts including you
82+
- The consequence is that you cannot copy, distribute, modify other people's contributions to your project
83+
- Even if unlicensed code is published in a public repository, as a user, you generally don't have the permission from the creators of the software to use, modify, or share the software
84+
9485
## Open Sourcing
9586

96-
- The easiest way to "open source" your R package is to make the GitHub
97-
repository public
98-
- This allows for easy open source contributions from other developers via pull
99-
requests
87+
- The easiest way to "open source" your R package is to make the GitHub/code repository public
88+
- This allows for easy open source contributions from other developers via pull requests
10089
- Please check with your organization first:
10190
- Are they ok to publish the software?
10291
- What is the appropriate copyright holder?
@@ -137,7 +126,7 @@ reference:
137126
- Citations in author-year style, followed by `<doi:...>`
138127
- Reducing run time of tests, checks, examples, vignettes is important
139128
- Need to provide cross-platform portable code:
140-
CRAN runs checks on Windows, Mac, several Linux OS
129+
CRAN runs checks on Windows, Mac, and several Linux distributions
141130

142131
## CRAN (cont'd)
143132

@@ -153,7 +142,7 @@ package took 5 weeks and 6 submission attempts; painful experiences:
153142
- Your local Windows test system may be much faster than the CRAN system
154143
(e.g., 5 times)
155144
- Don't use "R Package for" in your package title
156-
- The description of the package must be provided with a doi reference
145+
- The description of the package must be provided with a DOI reference
157146

158147
## CRAN (cont'd) {.scrollable}
159148

@@ -181,7 +170,6 @@ Example message informing about the rejection of the last
181170
> r-devel-linux-x86_64-debian-gcc Check: Result: Note_to_CRAN_maintainers
182171
> Maintainer: 'Friedrich Pahlke'
183172
184-
185173
## R-Hub to the Rescue
186174

187175
::: columns
@@ -190,14 +178,31 @@ Example message informing about the rejection of the last
190178
:::
191179

192180
::: {.column width="70%"}
193-
- Free `R CMD check` runs on [different operating systems](https://docs.r-hub.io/#which-platform) before submitting to CRAN
181+
- Free `R CMD check` runs on [different operating systems](https://r-hub.github.io/rhub/reference/rhub_platforms.html) before submitting to CRAN
194182
- Supported by the R consortium
195-
- Typically used via the [website](https://builder.r-hub.io/)
196-
- There is also an R API: `rhub::check()` is comfortable
197-
- Note: New API with R-hub v2 since a few weeks ([details](https://r-hub.github.io/rhub/articles/rhubv2.html))
183+
- New v2 API relies on GitHub actions for checks
184+
- [Blog post](https://blog.r-hub.io/2024/04/11/rhub2/) with more details about the transition to the new API
185+
announcing the transition to the new API: <https://blog.r-hub.io/2024/04/11/rhub2/
186+
Typically used via the [website](https://builder.r-hub.io/)
198187
:::
199188
:::
200189

190+
## R-Hub Platforms
191+
192+
```{r}
193+
#| echo: true
194+
library(rhub)
195+
rhub::rhub_platforms()
196+
```
197+
198+
## GitHub Actions
199+
200+
- It is also possible to use GitHub Actions to run `R CMD check`
201+
- Free for public repositories, paid service for private repositories
202+
- Checks will be run every time someone pushes a commit to a repository hosted on GitHub
203+
- Easy setup from your R console: `usethis::use_github_action_check_standard()`
204+
- Script and documentation are developed and maintained by the `r-lib` organization [here](https://github.com/r-lib/actions/tree/v2/check-r-package)
205+
201206
# GitHub
202207

203208
## Tags
@@ -243,23 +248,23 @@ Example message informing about the rejection of the last
243248

244249
- [Licensing chapter](https://r-pkgs.org/license.html)
245250
- [All possible licenses for CRAN packages](https://svn.r-project.org/R/trunk/share/licenses/license.db)
251+
- [Compare and pick licenses](https://choosealicense.com/)
246252
- [GitHub releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases)
247253
- [CRAN Repository Policy](https://cran.r-project.org/web/packages/policies.html)
248-
- [R-hub builder](https://builder.r-hub.io/)
249254
- [Bioconductor packages](https://contributions.bioconductor.org/index.html)
250255

251256
# Exercise
252257

253258
Use the same repository created from template [https://github.com/kkmann/simulatr](https://github.com/kkmann/simulatr)
254259

255-
- Run CRAN like checks in RStudio: use `--as-cran` in check options
260+
- Run CRAN-like checks in RStudio: use `--as-cran` in check options
256261
- Look at the CI/CD checks reported on your GitHub repository
257262
- Where are the `R CMD check` results?
258-
- Enable github page through `use_pkgdown_github_pages`
263+
- Enable GitHub page through `use_pkgdown_github_pages`
259264
- Deploy the website with `pkgdown`
260265
- Need to change remote to `git`
261266
- Deploy the website through `use_github_action("pkgdown")`
262-
- (Optional) Check the automatic github page deploy action
267+
- (Optional) Check the automatic GitHub page deploy action
263268

264269
# License Information
265270

@@ -268,5 +273,7 @@ Use the same repository created from template [https://github.com/kkmann/simulat
268273
Friedrich Pahlke [`r fontawesome::fa("github")`](https://github.com/fpahlke/) [`r fontawesome::fa("linkedin")`](https://www.linkedin.com/in/pahlke/)
269274
- In the current version, changes were done by (later authors):
270275
Liming Li [`r fontawesome::fa("github")`](https://github.com/clarkliming),
271-
Philippe Boileau [`r fontawesome::fa("globe")`](https://pboileau.ca/)
276+
Philippe Boileau [`r fontawesome::fa("globe")`](https://pboileau.ca/),
277+
Alessandro Gasparini [`r fontawesome::fa("linkedin")`](https://www.linkedin.com/in/ellessenne) [`r fontawesome::fa("github")`](https://www.github.com/ellessenne) [`r fontawesome::fa("globe")`](https://www.ellessenne.xyz/)
278+
272279
{{< include _license_footer.qmd >}}

slides/download/install.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ install.packages(c(
1414
"styler",
1515
"lintr",
1616
"pkgdown",
17-
"remotes"
17+
"remotes",
18+
"rhub"
1819
))

0 commit comments

Comments
 (0)