Suppress ggpairs messages when generating plot

The progress = FALSE argument will work when printing the ggpairs plot.

ggp = ggpairs(mtcars, columns = c("mpg", "cyl", "hp", "disp"))
print(ggp, progress = F)  # no progress bar
print(ggp)  # progress bar

It may also depend how you knit. The function that call the progress bar is ggmatrix_gtable, with the default value as

 progress = interactive() && (pm$ncol * pm$nrow) > 15

Thus no progress bar is printed by default in a non-interactive session.


If you are familiar with dplyr syntax, maybe the following piping is the most elegant one which do not require saving intermediate variable

mtcars %>% 
  ggpairs(columns = c("mpg", "cyl", "hp", "disp", "am", "qsec")) %>%
  print(progress = F)

'progress' parameter in print function will soon be deprecated.

It can be passed to ggpairs itself:

library(GGally)
ggpairs(mtcars, 
        columns = c("mpg", "cyl", "hp", "disp", "am", "qsec"),
        progress = FALSE)

RStudio screenshot for ggpairs without progress:

ggpairs output without progress

Tags:

R

Ggally