Here's a more flexible version for debugging / reusability in Rscript. It not only prints to stderr at your request, but also allows you to pass a variable number of arguments, types, etc., For example printf .
v <- function(...) cat(sprintf(...), sep='', file=stderr())
Now you can do things like:
v("name: %s age: %d\n", name, age)
and etc.
arielf Dec 18 '14 at 20:43 2014-12-18 20:43
source share