I am looking to generate ggplot2 scatter plots for each variable combination.
We can use the mtcars dataset as an example -- how can I generate the following graph for every possible column combination?
mpg vs. cyl, mpg vs. disp, etc...
cyl vs. disp, cyl vs. hp, etc...
and so on....
ggplot(mtcars, aes(x = mpg, y = cyl)) +
geom_point(size = 3.5) +
guides(fill=guide_legend(override.aes=list(shape=21))) +
stat_cor(method = "pearson") +
geom_smooth(method = lm, alpha = 0.1, color = "black")
can a loop be generated and column names be recorded and graphs are sequentially generated and saved as a .tif?

....
....