Hey, here is one way to do it via lapply() and aes_string()
Create random data
ggdata <- data.frame(
Timepoints = c(1:5),
matrix(rexp(20, rate=.1), ncol=4))
colnames(ggdata) <- c('Timepoints', 'A', 'B', 'C', 'D')
ggdata
Timepoints A B C D
1 1 4.989092 5.805021 30.899651 16.831086
2 2 19.720387 8.898303 12.004030 17.947039
3 3 1.007443 3.966031 5.839473 4.721005
4 4 12.472524 8.367984 3.200908 21.200863
5 5 38.603744 2.362598 6.056351 10.085905
Use lapply() over the column names to create a separate plot, and return to a list object, p
library(ggplot2)
library(hrbrthemes)
p <- lapply(
colnames(ggdata)[2:5],
function(col) ggplot(ggdata, aes_string(x = 'Timepoints', y = col)) +
geom_point() +
geom_smooth(method=lm , color="red", fill="#69b3a2", se=TRUE) +
theme_ipsum())
Plot the data
require(cowplot)
plot_grid(
p[[1]], p[[2]], p[[3]], p[[4]],
ncol = 4,
labels = colnames(ggdata)[2:5])

There is also a way via facet_grid() and facet_wrap() (not shown here).
Kevin