Re: [R] Converting data frame to zoo

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat 08 Jul 2006 - 03:22:19 EST

Check out read.zoo in the zoo package.

On 7/7/06, Horace Tso <Horace.Tso@pgn.com> wrote:
> Dear list,
>
> I know this is really basic question but I just couldn't get anything
> to work. (I did a R site search with keywords "zoo" and "data frame" but

> the server timed out on me.)
>
> I have a time series which has the following (typical) format,
>
> DATE Open High Low Close
> Volume
> 01-JAN-2006 5.25 5.25 5.25 5.25
> 256
> ....
>
> I read the data in from a csv file with read.csv() and it defaulted to
> a data frame which I thought is fine. Now I want to convert it to zoo so
> I did
>
> x <- zoo(my.df)
>
> which works just fine. But the Date column has been turned into a
> factor. Is there a way to make it into a Date. I've tried,
>
> x$Date <- as.Date(x$Date)
>
> but R complains that
>
> Error in fromchar(x) : character string is not in a standard
> unambiguous format
>
> Thanks in advance.
>
> Horace W. Tso
>
>
>
>
>
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
>
https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jul 08 03:26:16 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 08 Jul 2006 - 04:15:31 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.