[R] tseries to csv or xls

Bunny, lautloscrew.com bunny at lautloscrew.com
Tue Nov 17 10:09:20 CET 2009


Hi all, 

is there a common way to write time series objects generated by  ts() to some .csv or .xls. 
write.table does not work by default since it expects a data.frame which a ts object is not. 
Therefore write.table creates a data.frame which basically ignores the rows and columns of ts objects and just saves one big vector. 
What I want to do is export it, the same way as a ts object is printed on console, like this:
         Qtr1        Qtr2        Qtr3        Qtr4
1990  1.80926644  1.57801902 -0.06466631 -0.89682263
1991  0.38314894  0.58986441  0.61502833  1.55998143
1992  1.34689938 -0.61304408  2.17411932  0.13529151
1993 -0.07747732  1.76763799  0.37560837  0.36530430
1994 -1.03461000  0.88674850  1.71258524  0.79961787

I hope email transmission does not blow the formatting :) Thx for any help in advance

matt 



More information about the R-help mailing list