Displaying 1 result from an estimated 1 matches for "dropverbose".
Did you mean:
do_verbose
2013 May 23
0
Code compilation: Drop certain statements in a function before calling it multiple times?
...t;...done\n", sep=""); }
}
res;
}
Even with verbose=FALSE, one pay an noticeable overhead due to it when
calling foo(verbose=FALSE). Thus, before calling it, i'd like to
pre-compile this function by dropping the verbose-related statements,
e.g.
if (verbose) {
fooT <- dropVerbose(foo);
}
such that I basically get:
fooT <- function(n=10, verbose=FALSE) {
res <- 0;
for (k in 1:n) {
res <- res + k;
}
res;
}
Just to clarify, the immediate use case for this is to compile local
functions, e.g.
bar <- function(..., verbose=FALSE) {
foo <- function...