Question Details

No question body available.

Tags

r ggplot2 plot ggfortify autoplot

Answers (2)

March 14, 2026 Score: 2 Rep: 78,367 Quality: Medium Completeness: 80%

Wrap the call to autoplot in suppressWarnigs and then add the theme you want.

library(ggplot2)
library(ggfortify)

First example in help("lm")
Annette Dobson (1990) "An Introduction to Generalized Linear Models".
Page 9: Plant Weight Data.
ctl
March 14, 2026 Score: 1 Rep: 168,603 Quality: Medium Completeness: 60%

I think the easy first-step is to suppress it using suppressWarnings(). However, this can be nuclear at times, and completely mask other warnings that may otherwise be informative/useful.

I suggest going one step further and only suppress those warnings. This can be done using withCallingHandlers (a sibling of tryCatch) and invokeRestart("muffleWarning").

suppressWarnings_ggfortify