You can use svunit for this purpose. svUnit package defines a framework for testing R code, not unlike jUnit for Java. It is inspired on the checkxxx() functions from the RUnit package and the same test unit files should be compatible with both svUnit and RUnit. However, the internal implementation is completely different and svUnit can also be used interactively, while RUnit is only designed to run test units written in files on disks.