Skip to content
Prev 248629 / 398502 Next

Problem converting zoo object (daily data) to a timeSeries object

On Thu, Jan 27, 2011 at 11:56 AM, John E. Kaprich <jkaprich at gmail.com> wrote:
There are a different number of headings and columns so the dates are
being interpreted as row names. Try this:

Lines <- " DJP         JJA          COW
2011/1/21            49.01     64.68     30.97
2011/1/20            48.62     63.78     31.11"

library(zoo)
DF <- read.table(textConnection(Lines))
z <- zoo(DF, rownames(DF))