Skip to content

Fix split() to dispatch to base::split() for non-data-frame input - #125

Merged
ielbadisy merged 1 commit into
mainfrom
fix/split-base-dispatch
Sep 16, 2026
Merged

ielbadisy merged 1 commit into
mainfrom
fix/split-base-dispatch

Conversation

@ielbadisy

Copy link
Copy Markdown
Owner

Summary

  • split() unconditionally treated its first argument as a table, breaking the base R idiom split(vector, factor) for any non-data-frame input, including inside R Markdown/Quarto's own rendering pipeline (which calls split() unqualified internally)
  • split() now checks is.data.frame() and dispatches to base::split() when the input is not a table, keeping table-splitting behavior unchanged
  • Bumps to 1.4.2, updates NEWS.md and cran-comments.md for resubmission

Test plan

  • devtools::test() -- 783 pass, 0 fail
  • R CMD check --as-cran -- 0 errors, 0 warnings, 3 benign NOTEs (days-since-update, local compiler flag, sandbox clock)
  • Manually verified split(1:10, rep(1:2,5)) matches base::split(), and split(iris, by="Species") still returns basetable pieces

split() unconditionally treated its first argument as a table, so
attaching basetable broke the base R idiom split(vector, factor) for
any non-data-frame input -- including inside R Markdown/Quarto's own
rendering pipeline, which calls split() unqualified internally and
would error with "cols must not be NULL" as soon as basetable was
attached, regardless of what else the document did.

split() now checks is.data.frame() and dispatches to base::split()
when the input is not a table, matching base R's behavior for vectors
while leaving the existing table-splitting behavior unchanged.

Bumps to 1.4.2 and updates cran-comments.md for resubmission.
@ielbadisy
ielbadisy merged commit 8d92711 into main Sep 16, 2026
5 checks passed
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.

1 participant