Hi,

I have a ts object called data.gas that has three economic variables: gasoline consumption (gas), price per gallon (price), and household income (income) by month from January 1970 to December 2008. I want to plot this gas and price variables using ggplot2, but ggplot2 will not allow an object of class mts or ts; it has to be a data frame. When I use as.data.frame(data.gas), the date information is lost. How can I capture the date information in a vector so I can add it to a data frame created using as.data.frame?

Thanks,

Walt



--
________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
dataanalyt...@earthlink.net
www.dataanalyticscorp.com

______________________________________________
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.

Reply via email to