문제

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.

도움이 되었습니까?

해결책 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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top