I have this plot
dat = data.frame(group = rep("A",3),subgroup= c("B","C","D"), value= c(4,5,6),avg = c(4.5,4.5,4.5))
ggplot(dat, aes(x= group, y =value, color = fct_rev(subgroup) ))+
geom_point()+
geom_point(data = dat ,aes(x = group, y = avg), color = "blue",pch = 17, inherit.aes = FALSE)
I need to show 2 legends: 1 for the fct_rev(subgroup) which I already there but there is no legend for "avg".
How can i add a legend that is a blue triangle pch 17 with the title "avg?
thank you