[R-SIG-Finance] [R-sig-finance] converting to timeSeries

patzoul patzoul at free.fr
Tue Dec 30 21:46:29 CET 2008


I am loading data from a csv file:
x = read.csv("XFR00104.txt", header = FALSE)

The format is like this:
               V1       V2     V3     V4     V5     V6     V7
1   XFR0010411884 12/31/07  1  55.64  55.32  55.62   7244
2   XFR0010411884 01/02/08  1  56.80  54.50  56.75  58724
3   XFR0010411884 01/03/08  1  57.20  56.42  56.67 156879
4   XFR0010411884 01/04/08  1  58.98  56.28  58.43 138630

I would like to convert it to a timeSeries.

As a first step I converted the second column into dates:
x[,2] = as.Date(x[,2], format = "%m/%d/%y")

and then used the as.timeSeries function:
y = as.timeSeries(x[2:6])

but lost all the date information:
  V3     V4     V5     V6
  1  1  55.64  55.32  55.62
  2  1  56.80  54.50  56.75
  3  1  57.20  56.42  56.67
  4  1  58.98  56.28  58.43

What do I need to do to get a proper timeSeries?


-- 
View this message in context: http://www.nabble.com/converting-to-timeSeries-tp21222886p21222886.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list