Interactive debug of R packages

I come up against the following problem when making modifications to a package.

Let's say I make a change to one of the functions in my package and I break it. This results in my unittests failing (I'm using testthat). However, if it's not a trivial error and I would like to use RStudio's interactive debugger to fix it, the only way I can seem to do this is to cut and paste the unittest code into the actual .R file where the function that I have broken resides and 'source' that file. It's a very annoying process.

Can anyone suggest a smarter way to do this?

Answers


unitizer is a new unit testing package available on CRAN that is designed to streamline this exact type of issue by dropping you into an interactive prompt with the evaluation environment of the failing test. You can then debug the failing function and see why it is failing.


Need Your Help

How Synchronous/blocking are Events/Delegate subscriptions?

c# .net multithreading

How is this code going to behave through processing time ? (i.e, how synchronous is it ?)