Question

I noticed that, under some, unknown to me circumstances, some functions, whether from base R (for example, gc()), or from external packages (for example, getCurlHandle() from RCurl), still produce output, even after explicitly disabling it via verbose = FALSE. I am curious about reasons for such behavior. The only workaround I found on SO is the recommendation to call invisible(), but for me it worked only for gc(), but not for getCurlHandle(). Would appreciate any comments and answers.

Was it helpful?

Solution 2

While preparing a reproducible example, I figured this out. The source of the questionable output was not getCurlHandle(). It has been producing by another (next) function: curlSetOpt(). I took care of disabling its output by using invisible().

It was really not bad, comparing with the effort I've made for figuring out my previous R and RCurl problem. But, it is always fun and educational.

OTHER TIPS

The command gc(verbose=TRUE):

  1. prints some statistics and percentages,
  2. AND prints the matrix that is returned by the function.

The command x=gc(verbose=TRUE) only prints the statistics.

The command gc(verbose=FALSE) only prints the returned matrix.

The command x=gc(verbose=FALSE)prints nothing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top