-
Notifications
You must be signed in to change notification settings - Fork 1k
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
add support for melt(id.vars=measure()) #6880
base: master
Are you sure you want to change the base?
Conversation
@@ -183,6 +183,13 @@ melt.data.table = function(data, id.vars, measure.vars, variable.name = "variabl | |||
verbose = getOption("datatable.verbose")) { | |||
if (!is.data.table(data)) stopf("'data' must be a data.table") | |||
if (missing(id.vars)) id.vars=NULL | |||
id.sub = substitute(id.vars) |
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 just copied the code for measure.vars and changed to id.vars -- do you think we should try a for loop instead? or is this ok?
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.
(for loop over measure.vars and id.vars to emphasize they are handled via the same logic)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6880 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 79 79
Lines 14661 14670 +9
=======================================
+ Hits 14455 14464 +9
Misses 206 206 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Generated via commit 267c830 Download link for the artifact containing the test results: ↓ atime-results.zip
|
I can take a look, wondering if anyone else is more suitable, I still don't feel very familiar/facile with the "new" |
I'm the main melt API person, maybe @jangorecki could review? |
Closes #6867