I have a simple plot in ggplot2 and want to add a dashed regression line. So far I have:
library(ggplot2)
ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE) +
theme_bw()
Which returns what I want, but with a solid line:
I want to make the line dashed. I think I should use scale_linetype_manual()
but my attempts have been hacky.
A simple question, but I couldn't find a duplicate.