Please try: data <- xts(data[,2:n], order.by=as.POSIXct(strptime(data[,1], "%d/%m/%Y")))
Use similar strptime for hours also.n=number of columns. Good Luck Raghu On Fri, Jul 30, 2010 at 2:02 PM, Lily_stats [via R] < ml-node+2307936-1777222343-309...@n4.nabble.com<ml-node%2b2307936-1777222343-309...@n4.nabble.com> > wrote: > Hi, > > I am trying to convert my dataset into xts. I have tried the following : > > data1<-read.table("data1.txt",header=F) > data2<-read.table("data2.txt",header=F) > > data1.xts<as.xts(data1,descr="my new xts object) > > However, I get an error : > > Error in as.POSIXlt.character(x, tz, ...) : > character string is not in a standard unambiguous format > > I understand that my date and time format might not be accepted and have > tried to convert this but failed. > > Could you suggest something ? > > My date is in the format : dd/mm/yyyy > My time is in the format : hh:00 > > Thank you in advance > > > > ------------------------------ > View message @ > http://r.789695.n4.nabble.com/Data-Handling-tp2307770p2307936.html > To start a new topic under R help, email > ml-node+789696-608741344-309...@n4.nabble.com<ml-node%2b789696-608741344-309...@n4.nabble.com> > To unsubscribe from R help, click here< (link removed) >. > > > -- 'Raghu' -- View this message in context: http://r.789695.n4.nabble.com/Data-Handling-tp2307770p2307959.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.