Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add support for melt(id.vars=measure()) #6880

wants to merge 3 commits into from

Conversation

tdhock
Copy link
Member

@tdhock tdhock commented Mar 22, 2025

Closes #6867

@tdhock tdhock marked this pull request as ready for review March 22, 2025 10:01
@tdhock tdhock requested a review from MichaelChirico as a code owner March 22, 2025 10:01
@@ -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)
Copy link
Member Author

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?

Copy link
Member Author

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)

Copy link

codecov bot commented Mar 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.59%. Comparing base (6aa99f5) to head (267c830).
Report is 12 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

github-actions bot commented Mar 22, 2025

Comparison Plot

Generated via commit 267c830

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 4 minutes and 49 seconds
Installing different package versions 8 minutes and 28 seconds
Running and plotting the test cases 2 minutes and 33 seconds

@MichaelChirico
Copy link
Member

I can take a look, wondering if anyone else is more suitable, I still don't feel very familiar/facile with the "new" melt() API. WDYT?

@tdhock
Copy link
Member Author

tdhock commented Mar 27, 2025

I'm the main melt API person, maybe @jangorecki could review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

melt could support patterns for id.vars
2 participants