[Rd] [External] Re: quiet namespace load is noisy

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Tue Jul 23 15:51:58 CEST 2019


  Does setting message=FALSE in the chunk options of the vignette help?

  Or less preferably, using supressMessages() ?

On 2019-07-23 9:36 a.m., Lenth, Russell V wrote:
> Lionel,
> 
> Thanks for your response. I understand that method overriding can be a serious issue, but as you say, this is not something that the user can act upon. Yet the message lands at the user’s feet. 
> 
> In my case, the messages are cluttering my package vignettes, and may or may not represent what users see if they themselves run the vignette code, depending on what version of ggplot2, etc. they have. I will certainly update my ggplot2 installation and that will help. But basically I don’t ever want these kinds of messages to appear in my vignettes, so I will seek some other workaround. 
> 
> Russ
> 
> Sent from my iPhone
> 
>> On Jul 23, 2019, at 1:32 AM, Lionel Henry <lionel using rstudio.com> wrote:
>>
>> Hello,
>>
>> I think `quietly` should only silence normal masking messages
>> intended for users and providing information about normal
>> behaviour, such as masking.  This is not the case here as the
>> message is about overriding of S3 methods, which has global
>> effect and is rather problematic. It may change behaviour of
>> package and script code in unpredictable ways.
>>
>> This is not something that the user can act upon, the developers
>> of the parties involved need to be contacted by users so they can
>> fix it (the developers of the conflicting methods might not be
>> aware if the generic is from a third party package, such as
>> base::print()). In the case of ggplot2 vs rlang, you can update
>> ggplot2 to the latest version to fix these messages.
>>
>>> After all, other package startup messages ARE suppressed, and
>>> even error messages are suppressed
>>
>> Note that `quietly = TRUE` does not really suppress error
>> messages for missing packages. The errors are converted to a
>> boolean return value, and thus become normal behaviour, for which
>> it makes sense to suppress the message. This does not imply the
>> S3 overriding message should be suppressed as well.
>>
>> Best,
>> Lionel
>>
>>
>>> On 23 Jul 2019, at 06:29, Lenth, Russell V <russell-lenth using uiowa.edu> wrote:
>>>
>>> Dear R-devel,
>>>
>>> Consider the following clip (in R version 3.6.0, Windows):
>>>
>>>> requireNamespace("ggplot2", quietly = TRUE)
>>>   Registered S3 methods overwritten by 'ggplot2':
>>>     method         from 
>>>     [.quosures     rlang
>>>     c.quosures     rlang
>>>     print.quosures rlang
>>>
>>> It seems to me that if one specifies 'quietly = TRUE', then messages about S3 method overrides should be quieted along with everything else. After all, other package startup messages ARE suppressed, and even error messages are suppressed:
>>>
>>>> requireNamespace("xyz", quietly = TRUE)
>>>> ## (it is silent even though there is no "xyz" package)
>>>
>>> Thanks
>>>
>>> Russ Lenth
>>> U of Iowa
>>>
>>> ______________________________________________
>>> R-devel using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



More information about the R-devel mailing list