s-news
[Top] [All Lists]

old format of time series

To: s-news@lists.biostat.wustl.edu
Subject: old format of time series
From: TzamouranisY@LouisDreyfus.com
Date: Fri, 22 Jul 2005 09:59:11 -0400
The old(er) "ts" function in SPLUS has some advantages over new functions.
The main advantage I find - and still use it for this - is the formating:
          Jan      Feb      Mar      Apr      May      Jun      Jul
Aug      Sep      Oct      Nov      Dec
1985: 336.1270 321.5090 329.6240 341.9080 356.6300 344.0580 326.9770
318.4740 317.3650 313.6870 320.9430 320.8920
1986: 331.6770 331.7240 340.9000 337.7910 328.6400 326.6540 341.7980
332.7130 337.7990 343.8920 339.0840 331.2240
1987: 333.0290 331.8580 332.4510 328.9570 324.7030 327.5980 323.7500
332.4680 337.1640 355.8940 363.6370 348.9950
1988: 345.5830 348.0210 354.0030 357.3770 359.6650 358.8580 349.4900
333.5640 328.5600 339.5880 337.0140 330.3590

When the time series is inserted in reports , it allows you to see
seasonality and year-over-year trends for particular months.
Nevertheless, that is only true when it is printed.
Does anyone have a simple way to create a matrix of that exact format?
I looked at the printing method - but that is hidden in C and could not
find a way to use it to return a matrix or data frame where:
- the rows would be named by the year
- the columns would be named after the month.
I can imagine a complex way of doing this (breaking the data by year,
making a matrix by appending rows, naming the rows and the columns, etc).
Is there something more trivial that I am missing?

Thanks,

Yannis Tzamouranis


<Prev in Thread] Current Thread [Next in Thread>