Hello,<div>I have been thinking about how data.table deals with dateTime and would like to share my questions/opinions.</div><div><br></div><div>Where I think data.table is (likely to be wrong :))</div><div>At the moment data.table deals independently with IDate and ITime (%H:%M:%S) that are simple (Matthew Doyle words) derived class. As I understand it they are stored as integers to enable fast radix sorting etc...</div>
<div>There is no milli/micro/nano which is a problem as far as financial time series are concerned.</div><div><br></div><div>Suggestions:</div><div>Would that be possible to store a IDateTime as the number of micro since epoch-time ?</div>
<div>an IDateTime object would be represented like a=as.IDateTime("2010-01-03 09:34:54.342697"), then </div><div><br></div><div>year: asIYear(a); #would display "2010"</div><div>month: as.IMonth(a); #would display "2010-01"</div>
<div>date: as.IDate(a); #would display "2010-01-03"</div><div>etc...</div><div><br></div><div>Having all those built-in types would probably be useful to efficient grouping.</div><div><br></div><div>PS:</div><div>
The best soft I have experienced, to deal with timeseries, data is kdb (<a href="http://kx.com/">http://kx.com/</a>)</div><div>I particularly like the way datetimes are handled (<a href="http://code.kx.com/wiki/JB:QforMortals/atoms#time">http://code.kx.com/wiki/JB:QforMortals/atoms#time</a>), it may be a source of inspiration...</div>