[R] how to create time series object

Gabor Grothendieck ggrothendieck at gmail.com
Tue Nov 10 12:09:41 CET 2009


There are a number of packages that can do this.  With the zoo package
its like this:

library(zoo)
z <- zoo(c(123.231, 240), as.Date(c("2009-10-1", "2009-10-3")))

# now you can do:
z
plot(z)

See the 3 vignettes (pdf documents) that come with zoo:

vignette(package = "zoo") # lists them
vignette("zoo") # displays one of them

and the help files.

On Tue, Nov 10, 2009 at 12:17 AM, sdlywjl666 <sdlywjl666 at 126.com> wrote:
> Dear all,
> Could you tell me how to create time series object,
> time=c('2009-10-1','2009-10-3','2009-10-4'...)
> data=c(124,231,240...)
>
>
> Thanks!
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>




More information about the R-help mailing list