Skip to content

2.4: Miscellaneous

Ian Lyttle edited this page Jun 13, 2022 · 7 revisions

2.4.1 as_function()

No files to be templated in.

Tasks

  1. To seasons_intermediate() add:

    # accept purrr-style anonymous functions
    fn_points_per_win <- rlang::as_function(fn_points_per_win)
  2. add documentation, tests

Results

  • We can use purrr-style anonymous functions as arguments.
  • R CMD CHECK happy

2.4.2 Creating S3 class using {vctrs}

Files to be templated in:

  • R/result.R
  • tests/testthat/test-result.R

Tasks

  1. This will likely be an instructor-led walkthrough, as our brains will be fried by this point.
  2. usethis::use_package("glue")
  3. usethis::use_package("vctrs")
  4. add #' @import vctrs to R/ussie-package.R.

Results

  • We can show win/loss/draw results in a tibble.
  • R CMD CHECK happy

2.4.3 Done 🎉

👈 note for Ian: we are here in the branch-building process

Clone this wiki locally