Skip to content

Commit 32e8b09

Browse files
authored
Merge pull request #12 from openstatsware/chapter5-edits
Audrey's inputs for chapter 5
2 parents 7a30c48 + bcec270 commit 32e8b09

2 files changed

Lines changed: 80 additions & 11 deletions

File tree

slides/01_intro.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ knitr::include_graphics("resources/pkg_graph.png")
273273
[`r fontawesome::fa("linkedin")`](https://www.linkedin.com/in/philippe-boileau-773270205/)
274274
[`r fontawesome::fa("globe")`](https://pboileau.ca/)
275275
- In the current version, changes were done by (later authors):
276-
Audrey T. Yeo
276+
Audrey Yeo Te-ying
277277
[`r fontawesome::fa("linkedin")`](https://www.linkedin.com/in/audreyyeo8000/)
278278
[`r fontawesome::fa("github")`](https://github.com/audreyyeocH)
279279
Alessandro Gasparini

slides/05_publication.qmd

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ author: Audrey T. Yeo
2020

2121
- `pkgdown` makes it quick and easy to build a website for your package
2222
- After installing `pkgdown`, run `usethis::use_pkgdown()` to get started
23+
- Alternatively, run `usethis::use_pkgdown_github_pages()`
24+
- Adds (and writes) `pkgdown.yml`, `docs` folder, and "pkgdown" to `.Rbuildignore` and `docs` to `gitignore`. Also initialises empty branch `gh-pages` in chosen repo and activates GitHub Pages for repo [^1].
2325
- Main configuration happens in `_pkgdown.yml` file
2426
- Many customizations can be applied, but bulk of work during development is
2527
updating the `reference` section with names of `.Rd` files
28+
[^1]: `usethis::use_pkgdown_github_pages()` performs these actions additionally to `usethis::use_pkgdown()`.
2629

2730
## Example `_pkgdown.yml` File
2831

@@ -198,19 +201,20 @@ rhub::rhub_platforms()
198201

199202
## GitHub Actions
200203

201-
- It is also possible to use GitHub Actions to run `R CMD check`
204+
- It is also possible to use [GitHub Actions](https://docs.github.com/en/actions) to run `R CMD check`
202205
- Free for public repositories, paid service for private repositories
203206
- Checks will be run every time someone pushes a commit to a repository hosted on GitHub
204207
- Easy setup from your R console: `usethis::use_github_action_check_standard()`
208+
- ( runs a standard `R CMD check ` on three major operating systems. )
205209
- Script and documentation are developed and maintained by the `r-lib` organization [here](https://github.com/r-lib/actions/tree/v2/check-r-package)
206210

207211
# GitHub
208212

209213
## Tags
210214

211215
- Tags are a feature of Git, i.e., not specific to GitHub
212-
- Git can tag specific points in the code history as being important
213-
- Typically, for each release, create a tag `vx.y.z`
216+
- Git can tag (or "bookmark") specific points in the code history as being important
217+
- Typically, for each release, create a tag `vx.y.z` (MAJOR.Minor.patch format)
214218
- The value here is that users can later check out the package
215219
in the state of this release version
216220
- Download in R: `remotes::install_github("org/package", ref = "vx.y.z")`
@@ -222,12 +226,17 @@ rhub::rhub_platforms()
222226

223227
## Releases
224228

225-
- Based on Git tags, and a feature of GitHub
229+
- [Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases) are based on Git tags, and a feature of GitHub
226230
- Are "deployable software packages to make them available for a wider audience
227231
to download and use"
228232
- Contain release notes and links to the binary package files for download
229233
- However, for R packages these `tar.gz` package files are rarely used
230234
directly
235+
236+
```{Bash}
237+
#| eval: false
238+
git diff v0.3.14 v0.3.15 # checking for difference in mmrm release
239+
```
231240

232241
## Releases: Example
233242

@@ -239,7 +248,8 @@ rhub::rhub_platforms()
239248

240249
- The [Bioconductor](https://www.bioconductor.org/) project develops, supports,
241250
and disseminates open source software for the analysis of biological assays
242-
- Like CRAN, Bioconductor has additional package requirements
251+
- Like CRAN, Bioconductor has additional package requirements.
252+
One can only submit either to CRAN or Bioconductor.
243253
- Packages are peer reviewed by community members
244254
- New packages and updates to existing packages are released semi-annually
245255
- Software is expected to be interoperable with other Bioconductor packages
@@ -254,17 +264,74 @@ rhub::rhub_platforms()
254264
- [CRAN Repository Policy](https://cran.r-project.org/web/packages/policies.html)
255265
- [Bioconductor packages](https://contributions.bioconductor.org/index.html)
256266

267+
## Quick quiz (One correct answer only)
268+
269+
::: columns
270+
::: {.column width="40%"}
271+
1. I am cloning / forking a repo that has an MIT Licence. Which license shall I use if I want to make modification and distribute my new package ?
272+
a. MIT Licence
273+
b. one of any copyleft Licences
274+
c. no licence assumes transfer of my rights from the original repo
275+
:::
276+
277+
::: {.column width="10%"}
278+
:::
279+
280+
::: {.column width="40%"}
281+
2. I want to build a website for my package. Which file can I *mainly* configure my website in ?
282+
\
283+
\
284+
\
285+
a. `_pkgdown.yml` file
286+
b. .gitignore
287+
c. any .Rd file
288+
:::
289+
:::
290+
291+
## Quick quiz (Solutions)
292+
293+
::: columns
294+
::: {.column width="40%"}
295+
1. I am cloning / forking a repo that has an MIT Licence. Which license shall I use if I want to make modification and distribute my new package ?
296+
a. MIT Licence
297+
b. **any licence**
298+
c. no licence because that assumes transfer of my rights from the original repo's MIT Licence
299+
:::
300+
301+
::: {.column width="10%"}
302+
:::
303+
304+
::: {.column width="40%"}
305+
2. I want to build a website for my package. Which file can I *mainly* configure my website in ?
306+
\
307+
\
308+
\
309+
a. **`_pkgdown.yml` file**
310+
b. .gitignore
311+
c. any .Rd file
312+
:::
313+
:::
314+
257315
# Exercise
258316

259-
Use the same repository created from template [https://github.com/kkmann/simulatr](https://github.com/kkmann/simulatr)
317+
Use your project from *chapter 2* :
318+
319+
- Run CRAN-like checks in RStudio:
320+
- Go to Tools -> Project Options -> Build Tools -> "Check package - R CMD check additional options" : -> type "--as-cran"
321+
322+
- Alternatively, use `--as-cran` in argument in console :
323+
324+
```{r}
325+
#| eval: false
326+
rcmdcheck::rcmdcheck("myrootdir", args = "--as-cran")
327+
```
260328

261-
- Run CRAN-like checks in RStudio: use `--as-cran` in check options
262329
- Look at the CI/CD checks reported on your GitHub repository
263330
- Where are the `R CMD check` results?
264331
- Enable GitHub page through `use_pkgdown_github_pages`
332+
- (nested in this [`use_pkgdown_github_pages`](https://pkgdown.r-lib.org/articles/pkgdown.html) includes : `use_pkgdown()`, `use_github_pages()`, `use_github_action("pkgdown")`)
265333
- Deploy the website with `pkgdown`
266-
- Need to change remote to `git`
267-
- Deploy the website through `use_github_action("pkgdown")`
334+
- Set up a GitHub action to deploy website `use_github_action("pkgdown")`
268335
- (Optional) Check the automatic GitHub page deploy action
269336

270337
# License information {.smaller}
@@ -275,6 +342,8 @@ Use the same repository created from template [https://github.com/kkmann/simulat
275342
- In the current version, changes were done by (later authors):
276343
Liming Li [`r fontawesome::fa("github")`](https://github.com/clarkliming),
277344
Philippe Boileau [`r fontawesome::fa("globe")`](https://pboileau.ca/),
278-
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/)
345+
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/), Audrey Yeo Te-ying
346+
[`r fontawesome::fa("linkedin")`](https://www.linkedin.com/in/audreyyeo8000/)
347+
[`r fontawesome::fa("github")`](https://github.com/audreyyeocH)
279348

280349
{{< include _license_footer.qmd >}}

0 commit comments

Comments
 (0)