Proposal: Internal as.Date.POSIXct()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Proposal: Internal as.Date.POSIXct()

Joshua Ulrich
I would like to propose a .Internal() POSIXct2Date() function, similar
to do_POSIXlt2D() in src/main/datetime.c.  I created a working
prototype, which is now included in Dirk Eddelbuettel's RApiDatetime

This prototype is a combination of asPOSIXlt and POSIXlt2D from R
Core.  The functions are essentially concatenated, with the extraneous
parts removed.  Directly converting from POSIXct to Date uses less
memory and is roughly twice as fast.

You can find the relevant bits in the commit on GitHub:

Would someone on R Core be interested in adding this function?  If so,
I can create a patch that includes all the necessary code additions
needed to make it a .Internal() function.

Thanks for your consideration!


Joshua Ulrich  |
FOSS Trading  |
R/Finance 2018 |

[hidden email] mailing list