Closed joshuaulrich closed 6 years ago
Merging #2 into master will increase coverage by
1.42%
. The diff coverage is84.78%
.
@@ Coverage Diff @@
## master #2 +/- ##
==========================================
+ Coverage 53.24% 54.67% +1.42%
==========================================
Files 5 6 +1
Lines 971 1017 +46
==========================================
+ Hits 517 556 +39
- Misses 454 461 +7
Impacted Files | Coverage Δ | |
---|---|---|
R/asDatePOSIXct.R | 100% <100%> (ø) |
|
src/init.c | 100% <100%> (ø) |
:arrow_up: |
src/datetime.c | 66.71% <82.05%> (+0.97%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 84aa1b0...6bc9320. Read the comment docs.
As of R-3.5.1, converting from POSIXct to Date creates an intermediate POSIXlt vector. This uses a non-trivial amount of memory. Directly converting from POSIXct to Date uses less memory and is roughly twice as fast.
This solution is a combination of asPOSIXlt and POSIXlt2D from RCore. The functions are essentially concatenated, with the extraneous parts removed.
The function name 'asDatePOSIXct' differs from the other rapi* names because it's not a RCore function. The name isn't as.Date.POSIXct() to avoid clashes with the current (or future) S3 method.