How to set up Automated Tests for Your R Package using testthat

Описание к видео How to set up Automated Tests for Your R Package using testthat

While R programmers usually test their code, these tests are often done interactively and not automated. As you work on your functions, you may break code accidentally or violate assumptions your code makes. In order to be notified as early as possible of such events, it makes sense to set up automated testing for your R package. The testthat package, in combination with usethis, offers great functionality for that.

Up to about 08:45 you get a working example of an automated test. If you'd like to see more, see the rest for a second example involving missing values. There we see that NAs are not always equal to NAs!

The testthat package is well documented - see
help(package = "testthat")
and read the vignettes.

To find out more, read the great R Packages book by Hadley Wickham and Jenny Bryan, which has a dedicated chapter on testing.
https://r-pkgs.org/index.html

Contact me, e. g. to discuss (online) R workshops / trainings / webinars:

LinkedIn:   / wolfriepl  
Twitter:   / statistikindd  
Xing: https://www.xing.com/profile/Wolf_Riepl
Facebook:   / statistikdresden  

https://statistik-dresden.de/kontakt
R Workshops: https://statistik-dresden.de/r-schulu...
Blog (German, translate option): https://statistik-dresden.de/statisti...

Playlist: Music chart history
   • Music Chart History  

Комментарии

Информация по комментариям в разработке