When you save ggplot2 plots, the output will be different depending on the image size. There is a nice blog post on plot scaling on the tidyverse blog. The final example they use is:
They are saving the plot and then displaying that image with knitr::include_graphics(). If you are using R Markdown or Quarto, is there a more elegant way to display a scaled plot (something that does not involve saving the plot and then loading that image)?
I'm guessing it's question of setting the options of the code chunk that creates the plot, and that the details here should help: https://r4ds.hadley.nz/quarto#sec-figures
You could set the fig-width, but you would have to define the width in an earlier chunk if you want it to be a variable. That's not particularly clean either.
To clarify on this, with any other method you would use, it would end up doing that. When setting fig-width or any other option, at some point R graphic device will be used to save an image file on disk, and then include it using the right syntax.
So doing ggsave + include_graphics() is exactly the same, just with more control for you on the two steps, which are usually done automatically internally by knitr.