/advRkoans

advRkoans is an interactive tutorial for learning advanced R programming by making tests pass

Primary LanguageROtherNOASSERTION

advRkoans

DOI R build status

advRkoans is an interactive tutorial for learning advanced R programming by making tests pass. Following the lessons from Hadley Wickham's Advanced R. Format inspired by Greg Malcom's Python Koans, which are in turn inspired by Edgecase's Ruby Koans.

Getting started

pgcudahy$ git clone https://github.com/pgcudahy/advRkoans
pgcudahy$ cd advRkoans
pgcudahy$ R
> devtools::load_all()
> walk_the_path()
══ Thinking about expectations ═════════════════════════════════════════════════
   expect truth has damaged your karma

You have not yet reached enlightenment ...
   -=> TRUE OR FALSE? <=- isn't true.

Please meditate on the following code:
   /Users/pgcudahy/advRkoans/inst/koans/about-expectations.R#5:1
     testthat::expect_true(`___`)

You have completed 0 (0%) koans and 0 (out of 3) lessons.
You are now 16 koans and 3 lessons away from reaching enlightnment
> 

Most tests are fixed by opening the file with the test error in a text editor and filling in the missing parts of expect functions. Eg:

    testthat::expect_equal(`__`, 1+2)

which can be fixed by replacing the `__` part with the appropriate code:

    testthat::expect_equal(3, 1+2))