One of the advantages of divvying up your entire manuscript into functions, is that you can test that they perform properly.
To do so, we are going to use the package testthat
that has been designed to test functions written for packages, but it can be applied to any kind of functions.
Make sure you have testthat
installed:
install.packages("testthat")