Skip to content

Preserving dates in Excel.

1 message · Patnaik, Tirthankar

#
Hi Peter, Prof. Ripley,

	You're right--I just realized I was exporting a matrix, after converting the data-frame using data.matrix, where the date characteristics are lost.

 
Basically a function I was running converted the dataframe to a matrix first--something I'd forgotten.
Warning message:
class information lost from one or more columns in: data.matrix(head(Banks.Index.daily[, 1:5]))
Date   SBI.BO HDFC.BO KTKM.BO YESB.BO
2001-01-01 11323 102944.3 64134.8  3576.4      NA
2001-01-02 11324 108812.5 64390.9  3606.2      NA
2001-01-03 11325 114101.8 65909.5  3528.2      NA
2001-01-04 11326 112180.8 65266.3  3691.2      NA
2001-01-05 11327 113365.0 69286.3  3700.3      NA
2001-01-08 11330 112180.8 70292.8  3682.0      NA
"Date" "SBI.BO" "HDFC.BO" "KTKM.BO" "YESB.BO"
"2001-01-01" 11323 102944.3 64134.8 3576.4 NA
"2001-01-02" 11324 108812.5 64390.9 3606.2 NA
"2001-01-03" 11325 114101.8 65909.5 3528.2 NA
"2001-01-04" 11326 112180.8 65266.3 3691.2 NA
"2001-01-05" 11327 113365 69286.3 3700.3 NA
"2001-01-08" 11330 112180.8 70292.8 3682 NA
Apologies for the inconvenience.

Best,
-Tir