Re: [R] as.xts

2012-10-17 Thread sf631
Thanks for your response as well. It turned out that this was already a date typed file but I'll file this away for future reference when I come up against a string of characters -- View this message in context: http://r.789695.n4.nabble.com/as-xts-tp3028280p4646558.html Sent from the R help m

Re: [R] as.xts

2012-10-17 Thread sf631
Wow, that was exactly what I needed (and amazingly quick). Thanks for the help Joshua, that worked perfectly. As an aside, it appears that RODBC does keep the object classes (the date field came through as a date, not string...) -- View this message in context: http://r.789695.n4.nabble.com

Re: [R] as.xts

2012-10-17 Thread arun
2.1   A.K. - Original Message - From: sf631 To: r-help@r-project.org Cc: Sent: Wednesday, October 17, 2012 3:15 PM Subject: Re: [R] as.xts I'm not the original poster, but I do have the same question.  I have pulled in data via RODBC into a data frame, which looks like below

Re: [R] as.xts

2012-10-17 Thread arun
-- Original Message - From: sf631 To: r-help@r-project.org Cc: Sent: Wednesday, October 17, 2012 3:15 PM Subject: Re: [R] as.xts I'm not the original poster, but I do have the same question.  I have pulled in data via RODBC into a data frame, which looks like below and I&#x

Re: [R] as.xts

2012-10-17 Thread Joshua Ulrich
Hi Chad, as.xts.data.frame assumes the rownames are timestamps. Since this isn't the case for your object, you need to use the xts constructor: x <- xts(d$total, d$reportDate) This assumes your data.frame is named 'd' and that the reportDate column is actually a Date class (not character or fac

Re: [R] as.xts

2012-10-17 Thread sf631
I'm not the original poster, but I do have the same question. I have pulled in data via RODBC into a data frame, which looks like below and I'm getting the same error message: /("Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format") / The dat

Re: [R] as.xts

2012-07-16 Thread David Winsemius
On Jul 16, 2012, at 1:26 PM, John Kane wrote: Yolande, Attached files are usually deleted from the r-help list and I see no sign of your file. If you said that most attached files are scrubbed because posters did not read the Posting guide to determine which file types were acceptable,

Re: [R] as.xts

2012-07-16 Thread John Kane
Yolande, Attached files are usually deleted from the r-help list and I see no sign of your file. You can use the function dput() to output the your file in a format that you can paste into your email and which other readers can paste into R and use. See ?dput for more information. John Kane Ki

Re: [R] as.xts error

2010-12-06 Thread Joshua Ulrich
On Mon, Dec 6, 2010 at 5:57 AM, Gabor Grothendieck wrote: > On Mon, Dec 6, 2010 at 6:52 AM, Ted Zeng (曾振兴) wrote: >> >> Dear all, >> >> I am using the as.xts function to transfer a data frame to the xts >> >> The following is the code and result: >> >> a<-read.csv("price.csv") >> a$Date<-as.POSIX

Re: [R] as.xts error

2010-12-06 Thread Gabor Grothendieck
On Mon, Dec 6, 2010 at 6:52 AM, Ted Zeng (曾振兴) wrote: > > Dear all, > > I am using the as.xts function to transfer a data frame to the xts > > The following is the code and result: > > a<-read.csv("price.csv") > a$Date<-as.POSIXct(a$Date) > > str(a) > 'data.frame':   15637 obs. of  2 variables: >

Re: [R] as.xts

2010-11-05 Thread Joshua Wiley
Hi Ela, as.xts() calls as.POSIXlt() to convert the dates to a date/time class. Evidently, the the column that contains your times is not "unambiguous" to POSIX, that is, the format is not clear. It is really impossible to give you much more advice without having some sample data or what you actu

Re: [R] as.xts convert all my numeric data to character

2009-12-19 Thread ivan popivanov
Here is what worked for me: 1) Create a single xts object using one column and the index 2) Merge with the other columns tt = read.csv("c:/ttt/totalpc.csv", skip=1) xx = xts(tt$Call, order.by=as.Date(tt$Trade_date, format="%m/%d/%Y")) yy = merge(xx, tt$Put, tt$Total, tt$P.C.Ratio) coln