[R] plot acf of several timeseries
    Ulf Mehlig 
    ulf.mehlig at gmx.net
       
    Fri Apr 28 15:34:21 CEST 2006
    
    
  
Hello r-help, 
I have a couple of time-series of different length and I would like to
produce a simple overview plot showing the autocorrelation functions of
the series. The time-series are stored in a dataframe like this: 
        > test.data
              item year value
        1      xxx 1961 -1.09
        2      xxx 1962  0.21
        3      xxx 1963 -0.81
         [trimmed]
        8      yyy 1959  1.12
        9      yyy 1960  1.44
        10     yyy 1961 -1.97
         [trimmed]
I transformed them to a list of ts-objects and did the plotting via
lapply():
        > tslist <- by(test.data, test.data$item, 
                       function(x) ts(x$value, start=min(x$year), end=max(x$year)) )
        > par(mfcol=c(length(tslist), 1))
        > lapply(tslist, acf)
Is there a possibility to adapt the procedure so that the name of
"item" ('xxx', 'yyy', ...) is printed as title of each acf plot? I am
sure that there are better ways to produce this type of plot ... do you
have suggestions?
Many thanks, Ulf
-- 
 Ulf Mehlig    <ulf.mehlig at gmx.net>
    
    
More information about the R-help
mailing list