Managing multiple data streams in R
It is often useful to tap secondary information from a running R script. Obvious use cases include logging, and profiling of time or memory consuption. Perhaps less obvious cases include tracking changes in R objects or collecting output of unit tests (assertions). In this paper we demonstrate an approach that abstracts collection and processing of such secondary information from the code in the running script. The approach is implemented in pure R, and allows users to control the secondary information stream stream without global side effects and without altering existing code. Although some elements of the approach discussed here have been applied in existing packages, the combination of elements proposed here appears thus far to have been overlooked.
READ FULL TEXT