There seems to be a bug in a R package named pgam:periodogram(). The function intensity happened to have two cos. One of them should be sin. Here is the correct version. function (w, x) { n

## R commands to explore time series data …

R commands to explore time series data ts(data) # create time series objects time(ts.data) # returns the time diff(ts.data, lag=1) # difference at the specified lag lag.plot(ts.data, 9, do.lines=FALSE) # plot with specified lags plot(stl(ts.data, “per”)) # decomposition of time