Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFixed .shallow to consistently retain keys and indices. #2337
Conversation
|
Gets a problem on foverlaps test in travis that I don't get locally. Will need to investigate. |
Codecov Report
@@ Coverage Diff @@
## master #2337 +/- ##
==========================================
+ Coverage 91.09% 91.14% +0.05%
==========================================
Files 61 61
Lines 11785 11804 +19
==========================================
+ Hits 10735 10759 +24
+ Misses 1050 1045 -5
Continue to review full report at Codecov.
|
|
Initially, my local tests didn't include fOverlaps since genomicRanges was not installed. Now, everything should be fixed. |
… to logic changes only (concerns shallow and keys)
Closes #2336.
Keys and indices are retained correctly by shallow if
retain.key = TRUEandcols != NULL.The largest possible part of an index is retained.
If the original index was on x1, x2, x3, and `cols = c("x1", "x2"),
the shallow copy gets the same index for c("x1", "x2") (if there was a native index on x1 and x2, this is kept)
Tests have been added.
A benchmark (code at end of this post) shows that there is no negative speed impact:
The improved key retainment makes it possible to clean
setattrcalls infoverlaps.Rwhile still passing all tests.Code for benchmark