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.
Since 1.9.6 You can convert directly from/to xts without losing index class. As simple as:
1.9.6
xts
as.data.table(master_1)
The index is added as the first column in the result data.table, it retains index Date or POSIXct classes.
data.table
Date
POSIXct