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

David Winsemius dwinsemius at comcast.net
Fri Mar 9 15:30:22 CET 2012


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 <- 10000
> 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)
>

Grrrr. 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



More information about the R-help mailing list