I have been trying to do the next task but without success.
t<-seq(1,5)
y1<-c(0.3,0.25,0.35,0.2,0.4)
data<-data.frame(t,y1)
ggplot(data,aes(x=t,y=y1)) +
geom_line(color="red") + geom_line(aes(x=t,y=y1+0.2),color="blue")+
scale_x_discrete(breaks=c("1","2","3","4","5"),labels=c("t-3","t-2","t-1","t","t+1"))+
ylim(0,0.8)
What I want is to replace the numbers in the x-axis by t-3,t-2,t-1,t,t+1. I found in other posts that I should use scale_x_discrete, but it doesnt work...