Creating a vector/list of time series from a data frame

R programming language resources Forums Data manipulation Creating a vector/list of time series from a data frame

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #501
    monthodon
    Member

    To whom it may concern:

    I am trying to create a list (or a vector) of time series from a data frame. Here is the R code

    OGData <- read.table("heartatk4R.txt", header=TRUE) OGCol <- ncol(OGData) # initialization of the list or vector of time series LTot <- c(NA,length=OGCol) # assignment of each column of the data frame to an element of the time series vector for (i in 1:OGCol) {LTot[i] <- ts(OGData[,i]);} Then I am getting the following Warning message Warning messages: 1: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 2: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 3: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 4: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 5: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 6: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 7: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length 8: In LTot[i] <- ts(OGData[, i]) : number of items to replace is not a multiple of replacement length and each element of the LTot vector is empty. Can this be done with the zoo time series object? Your help is appreciated on this matter. Thank you. Xavier. foussereauxj@hotmail.com

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy