turn off randomly appearing startup messages

Every so often, I see "RStudio Community is a great place etc etc" appear. When loading a package, when running a shiny app, ... Often it doesn't show up and then it's there. It has been inserted in log files as well when I catch the stream.

  1. How do I find which package is responsible for the message.
  2. How do I turn it off without having to wrap everything in suppressPackageStartupMessages()
1 Like

The only place in any tidyverse packages I can find, to my knowledge, is in ggplot2, which looks like it cycles through messages, and should only show up in an interactive session:

I remembered seeing something about this in data.table's NEWS recently (a few months back), and it looks like both data.table and tidyverse (the package) should have options for quiet, since there isn't a way to respect quietly = TRUE the onAttach(). For tidyverse it'soptions(tidyverse.quiet = TRUE)`.

It's well described in the data.table news item, below:

Do you already have that option set and ggplot2 isn't respecting it?

Hi Mara,

thank you for your answer and pointing out ggplot2. That was indeed the culprit. It doesn't seem to take the setting of the tidyverse option into account, but I actually never load the tidyverse package as a whole. I just load the ones I need.

Seems like the only option for now is to wrap library(ggplot2) in a suppressPackageStartupMessages() whenever scripts are started manually from a console.

Small annoyances are just part of the job I guess :slight_smile:

Thank you again!

1 Like

Hi Joris,

If I run the following in a fresh, interactive R session, I don't get anything back:

options(tidyverse.quiet = TRUE)
library(ggplot2)

Granted, I do have the tidyverse package installed, but it's not loaded or attached. So, that could be the difference. I just tested this in a new RStudio cloud project with only ggplot2 installed, and that does seem to make the difference.

If the tidyverse package is installed, and you're getting messages from ggplot2 in non-interactive sessions, it's definitely a bug.

I'm certainly not suggesting installing the tidyverse package as a solution. (I'm basically fleshing this out to be a feature request at this point).

Given ggplot2 is the source of the message, and we have a solution for this elsewhere, might we use the same convention directly in ggplot?

FWIW, we are thinking about how to do a better job of handling the levels of "chattiness"/verbosity with logging in mind.

This isn't quite the same scenario being discussed in the issue below, but it might be of interest nonetheless. (n.b. It's in principles, so it's decidedly "big-picture" — so, definitely go forth with your favourite workaround in mind).

Hi Mara,

In most cases I don't see anything either, as the message will only be shown a fraction of the time. Even without setting options(tidyverse.quiet = TRUE) I have to reset my R session about 10-20 times before I see the message. But when setting the option, I still see the message after trying a couple of times. So alas the ggplot2 message does not react to the tidyverse option it appears.

I installed the tidyverse package itself as well to have the option, but that didn't make much difference. I haven't seen it in a truly non-interactive log, but in our research it happens more often that scripts are started from within a R console. So I don't think it's a bug. It's also nothing big, there's a workaround. I was just wondering if I was missing something obvious. Thank you for helping out!

Cheers
Joris

Screenshot%20-%2012_09_2019%20%2C%2019_17_03

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.