Dear R collegues,
I'd like to use the time-series facilities of R and I'm not sure how to
set my dataset properly.
I have monthly data, so the description could be: ts(data,
start=c(1951,1), frequency= 12)
However, the data is a matrix of years (rows) and months (columns), as
follows:
s1 <- read.table("stdata.txt", header=TRUE)
s1[1:3, ]
YEAR JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
1 1951 1.7 0.6 -0.8 -0.6 -1.0 -0.3 -1.4 -0.7 -1.3 -1.4 -1.0 -1.0
2 1952 -1.2 -1.1 0.0 -0.5 0.6 0.5 0.4 -0.4 -0.3 0.2 -0.2 -1.6
3 1953 0.2 -1.0 -0.8 -0.1 -2.2 -0.3 -0.1 -1.9 -1.5 -0.2 -0.4 -0.7
How can I create a ts object from this format?