-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(7614): added redirection of data.frame at dcast and melt to dcast.data.table and melt.data.table #7634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Generated via commit a05b069 Download link for the artifact containing the test results: ↓ atime-results.zip
|
R/fcast.R
Outdated
| dcast.data.frame = function(data, ...) { | ||
| if (!is.data.frame(data)) stopf("'%s' must be a data.frame", "data") | ||
| data = as.data.table(data) | ||
| dcast.data.table(data, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove the error in dcast.data.table. Don't coerce.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
R/fmelt.R
Outdated
| ans | ||
| } | ||
|
|
||
| melt.data.frame = function(data, ...) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this constitutes a breaking change for packages/scripts using both {data.table} and {reshape2} (e.g. {WebAnalytics} or {BTSPAS}), which might result in the wrong S3 method being invoked.
Please investigate the interaction of your update with {reshape2}, e.g. the load order.
I think the solution is not to have a data.frame method, but to fake one in the dcast() generic like:
dcast = function(x, ...) {
if (!is.data.table(x) && is.data.frame(x)) return(dcast.data.table(x, ...))
UseMethod("dcast")
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have redirected data.frame to the dcast.data.table
currently fixing a few errors
Running test id 2365.2 Test 2365.2 produced 1 errors but expected 0
Expected:
Observed: argument "formula" is missing, with no default
Test 2365.2 produced 1 messages but expected 0
Expected:
Observed: Using 'v' as value column. Use 'value.var' to override
Will update the PR once this is fixed
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7634 +/- ##
==========================================
- Coverage 99.02% 99.01% -0.02%
==========================================
Files 87 87
Lines 16890 16896 +6
==========================================
+ Hits 16726 16730 +4
- Misses 164 166 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hii @MichaelChirico without coercing it is failing the following test error: object of type 'symbol' is not subsettable prolly due to fast subsetting in data tables which isnt present in data frames? |

Closes #7614
I added tests for data.frame to check if dcast and melt work directly but got the following error
Hence redirected data.frame to dcast.data.table directly similarly for melt