Skip to content

Time Series Data

3 messages · livia, Gabor Grothendieck, Achim Zeileis

#
Hi all, I have got some time series data. Data[[1]] is the data in the format
"1975-12-05 1975-12-12 1975-12-19...", data[[2]] is the time series data. I
would like to generate the time series format as 
1975-12-05  1.5
1975-12-12  2.3etc.

I am thinking about cbind(data[[1]],data[[2]]), but it results in 
      [,1]          [,2]
  [1,]    1     1.5
  [2,]    2     2.3

Could anyone give me some advice?
#
Check out the zoo package:

Lines <- "1975-12-05  1.5
1975-12-12  2.3
"

library(zoo)
# replace next line with z <- read.zoo("myfile.dat")
z <- read.zoo(textConnection(Lines))
plot(z)
z

vignette("zoo") # gives more info
On 7/16/07, livia <yn19832 at msn.com> wrote:
#
On Mon, 16 Jul 2007, livia wrote:

            
Have a look at the "zoo" package and its vignettes:
  vignette("zoo-quickref", package = "zoo")
  vignette("zoo", package = "zoo")

hth,
Z