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? -- View this message in context: http://www.nabble.com/Time-Series-Data-tf4088688.html#a11621776 Sent from the R help mailing list archive at Nabble.com.
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:> > 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? > -- > View this message in context: http://www.nabble.com/Time-Series-Data-tf4088688.html#a11621776 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
On Mon, 16 Jul 2007, livia wrote:> > 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?Have a look at the "zoo" package and its vignettes: vignette("zoo-quickref", package = "zoo") vignette("zoo", package = "zoo") hth, Z> -- > View this message in context: http://www.nabble.com/Time-Series-Data-tf4088688.html#a11621776 > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at stat.math.ethz.ch 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. > >