[R-SIG-Finance] how to deal with time series in R ??

Gabor Grothendieck ggrothendieck at gmail.com
Mon Dec 21 03:41:49 CET 2009


Try this and read the three vignettes (i.e. pdf documents) that come with zoo:

Lines <- "Date, x, y, z
05/12/2002, 12, 11, 10
06/12/2002, 3, 5, 6
10/12/2002, 4, 12, 8
11/12/2002, 6, 7, 7"

library(chron)
library(zoo)
z <- read.zoo(textConnection(Lines), header = TRUE, FUN = chron, sep = ",")
head(z)
plot(z)

There are also several other time series packages mentioned by others
in this thread.

On Sun, Dec 20, 2009 at 6:23 PM, Edouard Tallent <tallent_e at lycos.com> wrote:
> hi everyone !
>
> i have a 4-row table, the first column being dates starting from the 5 of
> dec 2002 (the format actually is dd/mm/yyyy), the remainings being 3
> variables consisting of numeric variables. the first line contains the
> headers of the rows. some lines are missing as data may have been recorded
> not so regularly.
>
> Date, x, y, z
> 05/12/2002, 12, 11, 10
> 06/12/2002, 3, 5, 6
> 10/12/2002, 4, 12, 8
> 11/12/2002, 6, 7, 7
> ...
> ...
>
> what do i have to do so that R understands that this is a time series, the
> first row being the row for dates ??
>
> along the R documention i have read on read.table, ts, time and various
> other functions, but i have been unsuccessful til then.
>
> thank you for your hints
>
> cheers,
> édouard.
>
>
>
>
>
>
>
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>



More information about the R-SIG-Finance mailing list