Skip to content
Prev 371482 / 398506 Next

require help

Assuming the input data.frame, DF, is of the form  shown reproducibly
in the Note below, to convert the series to zoo or ts:

library(zoo)

# convert to zoo
z <- read.zoo(DF)

# convert to ts
as.ts(z) #


Note:

DF <- structure(list(year = c(1980, 1981, 1982, 1983, 1984), cnsm = c(174,
175, 175, 172, 173), incm = c(53.4, 53.7, 53.5, 53.2, 53.3),
    with = c(60.3, 60.5, 60.2, 60.1, 60.7)), .Names = c("year",
"cnsm", "incm", "with"), row.names = c(NA, -5L), class = "data.frame")
On Sat, Sep 16, 2017 at 8:10 AM, yadav neog <yadavneog at gmail.com> wrote: