next up previous
Next: Time Series Plots Up: Appendix of S-Plus Code. Previous: Appendix of S-Plus Code.

Getting the data into Splus

 

The Nottingham temperature data set was obtained over the internet as an ASCII file and stored as nottem.dat. The first three lines of this file are

40.6 40.8 44.4 46.7 54.1 58.5 57.7 56.4 54.3 50.5 42.9 39.8
44.2 39.8 45.1 47.0 54.1 58.7 66.3 59.9 57.0 54.2 39.7 42.8
37.5 38.7 39.5 42.1 55.7 57.8 56.8 54.3 54.3 47.1 41.8 41.7

There is one line for each year of data (40.6 is the average for Jan., 1920, 40.8 for Feb., 1920, etc. until 39.8 which is the average temperature for Dec., 1920; then 44.2 is the value for Jan., 1921, and so forth). This is read into Splus and made into an Splus time series via

> raw.nottem_scan("/home/dcox/S.stuff/VenRip/MASS/nottem.dat")
> nottem_rts(raw.nottem,start=1920,frequency=12,units="months")

The housing start data is already an Splus time series data set (it comes with Splus), so one only need type its name hstart to access it.



Dennis Cox
Thu Jan 16 12:20:07 CST 1997