论文标题

一种从运行R代码派生信息的方法

A method for deriving information from running R code

论文作者

van der Loo, Mark P. J.

论文摘要

从运行的R脚本点击信息通常很有用。明显的用例包括监视资源(时间,内存)和记录的消耗。也许不太明显的情况包括跟踪R对象的变化,以调节单​​位测试的输出。在本文中,我们演示了一种方法,该方法将运行R脚本中的此类辅助信息收集和处理。我们的方法基于三个要素的组合。第一个元素是构建一种评估代码的自定义方法。第二个标记为\ emph {local masking},它涉及暂时掩盖面向Auser的功能,因此称为其替代版本。我们标记的第三个元素\ emph {local side效果}。这是指掩码函数将信息导出到辅助信息流的情况下,而无需更改全球状态。结果是一种在Pure R中构建系统的方法,该方法使用户可以创建和控制信息的次要流,对其工作流程的影响最小,而没有全球副作用。

It is often useful to tap information from a running R script. Obvious use cases include monitoring the consumption of resources (time, memory) and logging. Perhaps less obvious cases include tracking changes in R objects orcollecting output of unit tests. In this paper we demonstrate an approach that abstracts collection and processing of such secondary information from the running R script. Our approach is based on a combination of three elements. The first element is to build a customized way to evaluate code. The second is labeled \emph{local masking} and it involves temporarily masking auser-facing function so an alternative version of it is called. The third element we label \emph{local side effect}. This refers to the fact that the masking function exports information to the secondary information flow without altering a global state. The result is a method for building systems in pure R that lets users create and control secondary flows of information with minimal impact on their workflow, and no global side effects.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源