Dplyr messages are coming through into my Rmarkdown output despite "messsage=FALSE"

Lately (last few weeks, beginning of 2021: not sure when it first started) messages from dplyr operations are not being supressed by "message=FALSE" in the code block headers. Interestingly, a very simple reprex didn't replicate the problem so it's about something I'm doing regularly using Rstudio to knit Rmarkdown to html on my machine but not something I can replicate on the same set up with a clean Rmarkdown file, tidyverse and pander loaded. Clearly I can go on loading things until perhaps I recreate it in the reprex but I haven't time to do that now so I'll do two things:

  1. Try to see in my own work any things that are associated with it happening. I have tried and can't so far.
  2. Post this here to see if anyone else is seeing it and has more ideas.

Here is an example of the output.

Gender effect

This is a simple between participant effect in both occasion1 and occasion2.

Breakdown of scores by gender for both occasions.

summarise() has grouped output by ‘occasion’. You can override using the .groups argument.

occasion gender n minScore LCL obsMean UCL SDScore maxScore
t1 F 506 -4.6 0.56 0.71 0.86 1.7 6
t1 M 494 -5.4 -0.029 0.13 0.28 1.7 4.2
t2 F 506 -5.6 0.94 1.2 1.4 2.4 8.7
t2 M 494 -8.4 0.3 0.52 0.73 2.4 7

Adding missing grouping variables: occasion

occasion meanDiff LCLDiff UCLDiff obsG LCLG UCLG
t1 -0.58 -0.82 -0.36 -0.34 -0.46 -0.21
t2 -0.64 -0.94 -0.36 -0.27 -0.39 -0.15

That is from Rstudio 1.4.1103 on up to date Ubuntu 20.04 with R version information:

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          0.3                         
year           2020                        
month          10                          
day            10                          
svn rev        79318                       
language       R                           
version.string R version 4.0.3 (2020-10-10)
nickname       Bunny-Wunnies Freak Out

and these packages:

> subset(data.frame(sessioninfo::package_info()), attached==TRUE, c(package, loadedversion))
            package loadedversion
boot           boot        1.3-26
dplyr         dplyr         1.0.3
forcats     forcats         0.5.1
ggplot2     ggplot2         3.3.3
janitor     janitor         2.1.0
pander       pander         0.6.3
purrr         purrr         0.3.4
readr         readr         1.4.0
stringr     stringr         1.4.0
tibble       tibble         3.0.6
tidyr         tidyr         1.1.2
tidyverse tidyverse         1.3.0

Anyone else seeing this and have any suggestions? TIA,

Chris

Hi'

If you in general want to suppress the additional dplyr information this option will do so:

options(dplyr.summarise.inform = FALSE)

Brgds. Henrik

Perfect. Many thanks Henrik. I can confirm that this works at least in one Rmd file of mine where I was seeing these messages coming through. Surely it's a bug somewhere in the markdown knitting or in the dplyr creation of its messages that these aren't be suppressed by
messages=FALSE
in the code block headers?

I can't reproduce this.

Using this Rmd file, you'll see the message from summarise

---
title: "test"
date: "09/02/2021"
output: html_document
---

```{r}
library(dplyr)
```

```{r}
starwars %>%
  group_by(sex, birth_year) %>%
  summarise(mean(height))
```

But setting to message = FALSE, the message is correctly suppresed

---
title: "test"
date: "09/02/2021"
output: html_document
---

```{r}
library(dplyr)
```

```{r, message = FALSE}
starwars %>%
  group_by(sex, birth_year) %>%
  summarise(mean(height))
```

You may need to use last versions of every package, specifically rlang

Thanks. Yes, I did say: "it's about something I'm doing regularly using Rstudio to knit Rmarkdown to html on my machine but not something I can replicate on the same set up with a clean Rmarkdown file, tidyverse and pander loaded." I am also completely happy to assume that it's something local to my machine.

The only thing I can add currently is that all my packages are updated daily on this machine so I'm sure it's not out of date packages (just checked: rlang is at 0.4.10 which seems to be the latest version). It is clearly something that kicks in at some point in moderately long Rmarkdown files for me (> 300 lines of whatever sort, some >1k lines). I generally load all the packages I need at the start and only invoke the more occasional functions I might want later with package::function() calls rather than loading the full package so I had been thinking that perhaps it wasn't down to adding packages but I don't know enough about how maintains packages in the environment (nor, if it's pertinent, how knitr with cache=TRUE manages this). I've had some health issues so I am way behind with work and Henrik seems to have given me a fix that works for me so I can't see me managing to do more to debug: I'm sorry as I would love to (and do generally try to) but I have to face the todo list! Very best and thanks, Chris

1 Like

We don't need to ! We'll see if someone else encounter similar issue!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.