I'm using the function gee from the library(gee) gee(Y~X,id=clust.id,corstr="exchangeable",b=tmc$coef,family=binomial(link=logit),silent=T) Every time it runs, it dutifully prints out Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 user's initial regression estimate [,1] [1,] -4.5278335 [2,] -0.2737999 [3,] -0.9528306 [4,] 0.9393861 [5,] -0.6618903 Unfortunately, i run thousands of these and the output gets extremely lengthy. Is there any way to suppress this printout in R? Thank you, Josh _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. [[alternative HTML version deleted]]
joshua wells wrote:> > > Unfortunately, i run thousands of these and the output gets extremely > lengthy. Is there any way to suppress this printout in R? > > Thank you, > > Josh > >One function that comes to mind is sink() which allows you to redirect output somewhere else, such as a file or /dev/null which on unix-like systems is where unwanted data goes to die: sink('/dev/null') # Stuff you don't want to see. sink() # Stuff you do want to see. If you happen to be using Windows, you may be able to achieve more or less the same effect by sinking to a temporary file: sink( tempfile() ) Another function that may be useful is capture.output() Good luck! -Charlie ----- Charlie Sharpsteen Undergraduate Environmental Resources Engineering Humboldt State University -- View this message in context: http://www.nabble.com/gee%3A-suppress-printout-tp25866057p25866226.html Sent from the R help mailing list archive at Nabble.com.
On 13/10/2009, at 2:55 PM, joshua wells wrote:> > I'm using the function gee from the library(gee) > > > > gee(Y~X,id=clust.id,corstr="exchangeable",b=tmc$coef,family=binomial > (link=logit),silent=T) > > > > Every time it runs, it dutifully prints out > > > > Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 > user's initial regression estimate > [,1] > [1,] -4.5278335 > [2,] -0.2737999 > [3,] -0.9528306 > [4,] 0.9393861 > [5,] -0.6618903 > > > Unfortunately, i run thousands of these and the output gets > extremely lengthy. Is there any way to suppress this printout in R?I *was* going to suggest wrapping your call to gee() in suppressMessages() --- but that doesn't quite work. There are ***print()*** statements following the message statements, and there's no way to shut these up, as far as I know. So all you can do, I'm afraid, is edit the code for gee() and delete or comment out the offending message() and print() statements. Or prepend them by ``if(!silent)'' which would cause silent=TRUE to shut them up. Fortunately, since this is R, it's easy enuff to do. HTH. cheers, Rolf Turner P. S. I guess you could do some'at like sink("/dev/null") before the start of the sequence of calls to gee() and then sink() after they end, which would suppress all the unwanted bumff. But I would personally prefer the edit-the-code route. R. T. ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}