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 formula support for split #5393

Merged
merged 13 commits into from
Mar 1, 2024
Merged

add formula support for split #5393

merged 13 commits into from
Mar 1, 2024

Conversation

ben-schwen
Copy link
Member

@ben-schwen ben-schwen commented May 24, 2022

Closes #5392

We could also dispatch to by with

if (inherits(f, "formula"))
  by = attr(stats::terms.formula(f), "term.labels")
else
  return(lapply(split(x = seq_len(nrow(x)), f = f, drop = drop, ...), function(ind) x[ind]))

but then we would have to change doc, since usage of f is discouraged.

R/data.table.R Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.49%. Comparing base (07fd933) to head (cd6598f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5393   +/-   ##
=======================================
  Coverage   97.48%   97.49%           
=======================================
  Files          80       80           
  Lines       14859    14861    +2     
=======================================
+ Hits        14486    14488    +2     
  Misses        373      373           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

NEWS.md Outdated Show resolved Hide resolved
man/split.Rd Outdated Show resolved Hide resolved
@MichaelChirico MichaelChirico added this to the 1.16.0 milestone Feb 19, 2024
@MichaelChirico
Copy link
Member

@ben-schwen would you mind updating to current master?

NEWS.md Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
R/data.table.R Outdated Show resolved Hide resolved
man/split.Rd Outdated Show resolved Hide resolved
@ben-schwen ben-schwen requested a review from jangorecki as a code owner March 1, 2024 02:21
man/split.Rd Outdated Show resolved Hide resolved
man/split.Rd Outdated Show resolved Hide resolved
Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Long overdue at this point 😅

@MichaelChirico MichaelChirico merged commit 1822d35 into master Mar 1, 2024
5 checks passed
@MichaelChirico MichaelChirico deleted the split_formula branch March 1, 2024 18:33
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.

Error in unique.default(x, nmax = nmax): unique() applies only to vectors
2 participants