I am trying to make some quick graphs for search analysis and ask the following question:
How can I build a time series in ggplot? I am trying to do something like this:
ggplot(data,aes(x=xdata,y=xdata-1)+geom_point()
But it xdata-1subtracts 1 from xdatainstead of reading the previous value xdata.
ggplotdoesn't seem to have an equivalent lag.plot, and I found a function called gglagplotin the package ggfortifythat seems to be exactly what I want, but which is not available in the latest version of R (currently 3.2).
source
share