Suppose I have the following function:
## Just an example f = function() { for(i in 1:10000) cat(i) return(1) }
When I call
On Linux, you can use a sink() call to /dev/null(or to a temporary file on another OS, see ?tempfile) :
sink()
/dev/null
?tempfile
sink(file="/dev/null") f() sink()