Message-ID: <971536df0709302138u3c710b4cjc350696fb6e5bf72@mail.gmail.com>
Date: 2007-10-01T04:38:49Z
From: Gabor Grothendieck
Subject: convert time series to data.frame
In-Reply-To: <2d1ebb110709302127x25b5c2f6u133e01ce2ff4dbc3@mail.gmail.com>
Try this:
x <- ts(11:30, start = 2000, freq = 12)
data.frame(x = c(x), time = c(time(x)))
The time will be in years plus fraction of a year.
On 10/1/07, Edna Bell <edna.bell01 at gmail.com> wrote:
> Dear R gurus
>
> I would like to take a monthly time series and convert it to a data
> frame without losing the tsp items, pleae
>
> I've tried as.data.frame and data.frame but I get the series without
> the time element.
>
> Any suggestions, please?
>
> tia
>
> Edna Bell
>
> ______________________________________________
> R-help at 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.
>