How can I change XTS to data.frame and keep Index?

后端 未结 6 2005
时光说笑
时光说笑 2020-12-02 11:11

I have an XTS timeseries in R of the following format and am trying to do some processing, subsetting and re-arranging before exporting as a CSV for work in another program.

6条回答
  •  Happy的楠姐
    2020-12-02 12:13

    That's because the dates are rownames in your data.frame. You need to make them a separate column.

    Try this:

     data.frame(date=index(master_1), coredata(master_1))
    

提交回复
热议问题