Demo

System setup

Setup is not fun!

🧰 (no breakout room) Anything still amiss to report? 🀞


Package creation

πŸ‘€ usethis website

🧰 Repeat the same steps, post the link to your package repo in the chat!


A first function + docs + test

  • usethis::use_r("time"). Explain what sprintf() does.

  • devtools::load(), what_time().

  • add an argument.

  • devtools::load(), what_time(), what_time(language = "en").

  • add two dependencies, use_package("praise") and use_package("rlang").

  • devtools::load(), what_time(), what_time(language = "en").

  • Insert roxygen2 skeleton.

  • devtools::document(), ?what_time, show the Rd file.

  • use_testthat().

  • use_test("time"): first a simple test, then a snapshot test, then a snapshot of the error.

  • devtools::test() / test the file on its own via the button.

  • devtools::check()

  • Build and reload (install packages from RStudio build tab), try using the package from another session. Or install from GitHub.

πŸ‘€ roxygen2 website

πŸ‘€ testthat website

πŸ‘€ R Packages book, the whole game

🧰 repeat the steps!


Documentation

⚠️ rmarkdown and pkgdown needs your package to be installed.

πŸ‘€ pkgdown website

GitHub Actions

  • usethis::use_github_action_check_standard(). Check on the cloud, different operating systems.

  • usethis::use_github_action("pkgdown"), change GitHub pages settings of the repo, add URL to pkgdown config and to DESCRIPTION.

πŸ‘€ usethis support for GitHub Actions setup

🧰 Repeat the steps!