I am making a line plot with a trend-line in ggplot2 with geom_line, geom_point and geom_smooth. My code is similar to this.
year <- as.character(2011:2020)
x <- c(12, 13, 12.5, 14, 15, 17, 16, 18, 18, 19)
y <- c(25, 28, 30, 27, 30, 31, 30, 31, 33, 33)
dat <- data.frame(year, x, y) %>%
pivot_longer(cols = c(x,y), names_to = "item", values_to = "price")
ggplot(dat, aes(x=year, y=price, group=item, col=item))+
geom_line()+
geom_point(aes(shape=item))+
geom_smooth(method = "loess", se = FALSE, size=0.8, linetype="dotdash")+
labs(x = "Year",
y = "Price")
This results in the following plot:

I want to include the geom_smooth trendlines separately in the legend so that there will be four items in the legend- x, y, trendline of x and trendline of y. How should I proceed?
