Briggs, Meredith M
2004-Apr-29 06:53 UTC
[R] I'm trying to use package ts (decompose). How do you set up the data/ See attached. thanks
InDATA <-read.table("C:/Data/May 2004/season.txt",header=T) X <- decompose(InDATA) print(X) Period Connections Q1 67519 Q2 69713 Q3 68920 Q4 69452 Q1 70015 Q2 59273 Q3 57063 Q4 65596 Q1 73527 Q2 58586 Q3 69522 Q4 60091 Q1 51686 Q2 63490 Q3 55702 Q4 53200 Q1 51033 Q2 48175 Q3 52709 Q4 50106 Q1 50855 Q2 43466 Q3 48190 Q4 41702 Q1 48747 Q2 51441 Q3 42537 Q4 49145 Q1 41457 Q2 39306 Q3 43121 Q4 42777 Q1 40631 Q2 41764 Q3 44712 Q4 38669 Q1 41367 Q2 37515 Q3 36201 Q4 37650 Q1 35963 Q2 38097 Q3 39854 Q4 38307 Q1 39383 Q2 37015 Q3 46416 Q4 40359 Q1 38098 Q2 31419 Q3 31457 Q4 32817 Q1 29141 Q2 31210 Q3 29555 Q4 31102 Q1 32147 Q2 29351 Q3 33982 Q4 29781 Q1 32134 Q2 30048 Q3 27811 Q4 30126 Q1 26934 Q2 27758 Q3 28372 Q4 28631 Q1 29102 Q2 28372 Q3 33295 Q4 29182 Q1 30343 Q2 26944 Q3 26115 Q4 27551 Q1 25303 Q2 26854 Q3 26911 Q4 27225 Q1 28141 Q2 26710 Q3 32192 Q4 28281 Q1 28958 Q2 25624 Q3 24861 Q4 26459 Q1 23941 Q2 25578 Q3 25281 Q4 26070 Q1 26881 Q2 25496 Q3 30128 Q4 26471
Prof Brian Ripley
2004-Apr-29 11:13 UTC
[R] I'm trying to use package ts (decompose). How do you set up the data/ See attached. thanks
Package ts in R contains no functionality, it having been moved to package stats. The function ts() was not in package ts in older versions either. I have no idea what your data refer to (quarters, probably, but of which years?). Assumming you know the time base, see the help page ?ts for how to create a time series. BTW, read.table is intended for reading a table, not a single variable, and scan() might be easier. On Thu, 29 Apr 2004, Briggs, Meredith M wrote:> > InDATA <-read.table("C:/Data/May 2004/season.txt",header=T) > > X <- decompose(InDATA) > print(X)[...] -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595