R ggplot2 single line plot with 2 hlines legends
问题 I have a simple dataframe (WF) that looks like this: head(wf) Date Gals Days GpD GpM 2016-10-21 6.0 1 6.0 186.0 2016-10-22 6.0 1 6.0 186.0 2016-10-23 12.4 1 12.4 384.4 2016-10-24 26.8 1 26.8 830.8 2016-10-25 33.3 1 33.3 1032.3 2016-10-26 28.3 1 28.3 877.3 What I'm trying to do is time series plot Date versus Gals and put a horizontal line for the mean and median. The glitch I'm facing is correctly putting a legend on the plot. My code so far: require(ggplot2) p1<-ggplot(data=wf, aes(Date,