ts object to data frame code example Example: ts object to data frame data.frame(Y=as.matrix(dat), date=time(dat))