[tech-spec] For the R beginners...It's the tiny things in life that can make a difference...

  • From: "Vincent C. Fulco" <vfulco@xxxxxxxxxxxxx>
  • To: tech-spec@xxxxxxxxxxxxx
  • Date: Tue, 12 Apr 2005 09:17:51 -0400

Dear beginning R students on TechSpec-

I just stumbled across a small and very elementary item which has cleared up some confusion for me. Steve Wisdom was gracious enough to include a significant amount of price data in his Rolling US/SP code example from April 8th. At times, I like to look at the underlying raw data series in .txt format to understand how one might "store" large data sets for use in R. I'm still toying with a long term idea to store some fundamental IS/BS/CF statement items in RDBMS for further manipulation as we had reasonable success mining accounting data at my old firm even with the embedded time lag.

While reviewing the above .txt file, I could not understand the format since it appeared to be a list of instrument codes and then a series of lists each grouped by date.

SP1 ND1 VIX VXN Z_1 GX1 VG1 NI1 HI1 FDT TU1 TY1 US1 MOV USS G_1 RX1 JB1 EUR GBP CHF JPY CL1 HO1 HU1 NG1 GC1 PL1 SI1 HG1 S_1 W_1 O_1 C_1 LC1 FC1 LH1 PB1 SB1 KC1 CC1 CT1

1/1/1996 898.9 NA 12.52 NA 4416.5 3578.5 NA 19385 7979 5.50 91.03 78.17 78.03 88.52 38.5 85.93 76.56 90.10 NA 1.5525 1.1566 103.45 -15.83 -25.30 -50.09 6.760 494.3 218.3 7.04 128.55 467.25 860.25 197.50 481.75 58.85 NA 64.15 -20.90 8.76 56.30 1581 144.95

1/2/1996 905.5 NA 12.19 NA 4430.5 3626.0 NA 19385 8157 5.50 90.99 78.08 77.91 94.75 38.5 85.65 76.83 90.10 NA 1.5545 1.1590 103.95 -15.57 -23.99 -49.12 7.000 498.1 218.3 7.22 126.10 480.75 856.50 201.75 485.75 58.43 NA 62.12 -22.90 8.99 52.65 1594 144.57


So I asked myself, how does the read.table() function parse that data especially since I thought I understood data input by now?


Of course! How basic...By removing the "word wrap" feature on MS notepad which I use for readability, the data formats back to the original, correct and simple list of time series as Steve intended and expected it to be displayed.

Hope this mundane item helps,

Vince


Other related posts:

  • » [tech-spec] For the R beginners...It's the tiny things in life that can make a difference...