sameOutVar: sameOutVar

Description Usage Arguments Value

Description

this function provides a simple heuristic for when a block of code should be cached as a single entity. It returns true when all expressions in the block create or modify the same variable (or none at all), e.g., x=data.frame(y=rnorm(100), z=rnorm(100)) x$y[x$y > 3] = NA x$col3 = sample(1:4, 100, TRUE) x = x[1:50,]

Usage

1
sameOutVar(code)

Arguments

code

The code or ScriptNodeInfo to be assessed

Value

TRUE if one (or less) unique variable is output or updated across all expressions in code, FALSE if two or more unique variables are.


gmbecker/RCacheSuite documentation built on May 17, 2019, 6:42 a.m.