Repository navigation
Subset data frames with dplyr, not base [] - #112
Conversation
Ezra, 2026-11-10: "psc: let's use dplyr's filter() and select() to subset datasets in R, instead of base []". Adds the rule to the tidyverse-replacements page and a base_subset_linter() to lms, in default_linters(nested_calls = TRUE), that flags df[i, ] and df[, j]. Matrices take # nolint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9ngiGnksZTebJnriQk
undesirable_function_linter flags a local named message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9ngiGnksZTebJnriQk
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…subset rule Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9ngiGnksZTebJnriQk
|
Claude finished review — View run This matches the computed range exactly — no surprise files. The Both of the two blocking findings from the prior review round (commit Review: PR #112 — "Subset data frames with dplyr, not base
|
Built to branch |
Requested by Ezra · project thread
Closes #111.
Ezra, 2026-11-10: "psc: let's use dplyr's filter() and select() to subset datasets in R, instead of base [] (for example https://morrison-lab.github.io/lds/chapters/discriminant-analysis.html#sol-lab-knn-split)"
chapters/coding-style/tidyverse-replacements.qmd: new "Subsetting data frames" section.lms::base_subset_linter(): flags a[call with an empty index (df[i, ],df[, j]); added todefault_linters(nested_calls = TRUE); matrices take# nolint. Its tests pass locally (11 pass, 0 fail; the 2 warnings are thecyclocomppackage missing here).lms-refmoves to the merged commit in a later step; the check is diff-scoped, so no sweep.Generated by Claude Code