[R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread Hans Ekbrand
I need confint() for glm() to supress the messages 

Waiting for profiling to be done...

because they mess up the caching mechanism of pgfSweave (see
https://github.com/cameronbracken/pgfSweave/issues/40).

I have read the help page of confint(), but I do not know how to get
the help page for the glm() version, if any such help page exists.

Is there a general way of turning of output from functions in R, that
would help here?

Below is an example of an intended usage scenario:

x - 1
set.seed(42)
a - rnorm(x)
b - factor(LETTERS[sample(1:7, x, replace = TRUE)])
c - factor(LETTERS[sample(1:4, x, replace = TRUE)])
my.fit - glm(c ~ b + a, family = binomial)
my.results - confint(my.fit)

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread sina rueeger
In stats:::confint.glm (actually it is MASS:::confint.glm) you see that the
message() function is used to produce waiting for  To avoid this
message you can just use 
suppressMessages(confint(my.fit))
At least in R it works, hope it works with Sweave as well. 

Regards,
Sina

--
View this message in context: 
http://r.789695.n4.nabble.com/How-do-I-force-confint-for-glm-to-be-quiet-tp4459152p4459227.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread David Winsemius


On Mar 9, 2012, at 6:14 AM, Hans Ekbrand wrote:


I need confint() for glm() to supress the messages


I'm wondering if suppressMessages would be helpful? Which in turn  
suggests that you do not know how to use ??, so firt you should get  
in the habit of doing a helpSearch before posting.


??suppress messages



Waiting for profiling to be done...

because they mess up the caching mechanism of pgfSweave (see
https://github.com/cameronbracken/pgfSweave/issues/40).

I have read the help page of confint(), but I do not know how to get
the help page for the glm() version, if any such help page exists.


When I type ?confint.glm at my console I get this help page:

confint-MASS {MASS}




Is there a general way of turning of output from functions in R, that
would help here?


If suppressMessages is not effective then look at:

?sink




Below is an example of an intended usage scenario:

x - 1
set.seed(42)
a - rnorm(x)
b - factor(LETTERS[sample(1:7, x, replace = TRUE)])
c - factor(LETTERS[sample(1:4, x, replace = TRUE)])
my.fit - glm(c ~ b + a, family = binomial)
my.results - confint(my.fit)



G. A _minimal_ example would have had fewer iterations, but this  
does seem to be effective:


suppressMessages(my.results - confint(my.fit))


--
David Winsemius, MD
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How do I force confint() for glm() to be quiet?

2012-03-09 Thread Hans Ekbrand

On 2012-03-09 15:30, David Winsemius wrote:


On Mar 9, 2012, at 6:14 AM, Hans Ekbrand wrote:


I need confint() for glm() to supress the messages


I'm wondering if suppressMessages would be helpful? Which in turn 
suggests that you do not know how to use ??, so firt you should get 
in the habit of doing a helpSearch before posting.


??suppress messages

OK, noted.




Waiting for profiling to be done...

because they mess up the caching mechanism of pgfSweave (see
https://github.com/cameronbracken/pgfSweave/issues/40).

I have read the help page of confint(), but I do not know how to get
the help page for the glm() version, if any such help page exists.


When I type ?confint.glm at my console I get this help page:

Ah, I tried ?confint.lm without success and didn't go further.

If suppressMessages is not effective then look at:

?sink

OK, but since suppressMessages works, I'll stick to that.


G. A _minimal_ example would have had fewer iterations,

Sorry.

but this does seem to be effective:

suppressMessages(my.results - confint(my.fit))


Thanks!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.