Hi Raghu,

Please try:
stockdata <-  xts(stockdata[,2:5], order.by=as.POSIXct(strptime(stockdata[,1],
"%d/%m/%Y")))

instead of
stockdata <- xts(stockdata[,2:5],order.by=stockdata[,1],format="%d/%m/%Y")

Regards,

-Mark-

2010/7/17 Raghu <r.raghuraman@gmail.com>

> Following with the older mail I thought I nailed down the issue. stockdata
> is not an xts object and ergo i tried converting it to one as below but
> this
> again is not working.
>
> stockdata <- xts(stockdata[,2:5],order.by=stockdata[,1],format="%d/%m/%Y")
> Error in xts(stockdata[, 2:5], order.by = stockdata[, 1], format =
> "%d/%m/%Y") :
>  order.by requires an appropriate time-based object
>
> str(stockdata)
> 'data.frame':   3637 obs. of  5 variables:
>  $ Date..GMT.: Factor w/ 3637 levels "01/01/1996","01/01/1997",..: 321 687
> 807 929 1052 1172 1537 1650 1764 1886 ...
>  $ Open      : num  1000 1002 987 976 960 ...
>  $ High      : num  1000 1002 987 976 960 ...
>  $ Low       : num  1000 989 977 963 952 ...
>  $ Last      : num  1000 989 978 964 953 ...
>
>
> May be it has to do with the first column? Kindly advise.
>
> Thx
> Raghu
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

