visible data.table return in a few functions#130
Conversation
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
+ Coverage 48.40% 48.43% +0.03%
==========================================
Files 18 18
Lines 1345 1346 +1
==========================================
+ Hits 651 652 +1
Misses 694 694
Continue to review full report at Codecov.
|
range_wide_to_long|
This is something @seabbs and I discussed a year ago. I don't have strong opinions, but I reckon data.table people might. At the moment everything is handled using data.tables and I think for those it is not common practice to call |
|
Ah ok. Just looked at the issue #129 now and the link you posted (https://cran.r-project.org/web/packages/data.table/vignettes/datatable-faq.html#why-do-i-have-to-type-dt-sometimes-twice-after-using-to-print-the-result-to-console). I wasn't aware that this was a bug in data.table, rather than a feature... Then it makes sense to implement this everywhere. Thanks for pointing this out! |
|
I gave some thought to this and my preferred option would probably be to create a new The main benefit compared to the approach proposed here is that we don't have to check whether the returned object is a |
|
That's a much more elegant solution - so elegant in fact that I'm surprised that it's not suggested in the data.table FAQ. |
|
Love it. This would be nice to have in lots of other places so making the solution generic beyond |
|
@Bisaloo this sounds really good. Would you have time to make a PR for this, or shall I give it a try? |
|
I can submit a first draft for this but feel free to edit it as you see fit afterwards. |
|
Merged this PR. I think the solution proposed by @Bisaloo has the problem that a function won't automatically exit if you don't call the standard |
Fixes a few (but not all) instances of #129