Migrate to per-operation grouping with .by and add copilot instructions#24
Conversation
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
@copilot resolve conflicts |
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Conflicts resolved. Merged the Resolved in commit 8e4d860. |
|
@copilot R/update_possible_subj_data.R:62 this .by statement should use tidy selection, not data masking; please add a note in the copilot instructions to differentiate between these two; see https://dplyr.tidyverse.org/articles/programming.html for details |
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Fixed. The Also added a comprehensive "Tidy Selection vs. Data Masking" section to the copilot instructions explaining:
Addressed in commit 74fe60f. |
|
@copilot resolve merge conflicts and use quoted strings for tidy-select |
Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Resolved. Merged the Changes:
This avoids R CMD check warnings about undefined global variables while maintaining the correct tidy selection syntax (not data masking). Updated copilot instructions to recommend quoted strings as the preferred approach for tidy selection in Addressed in commit 1c35bff. |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
Addresses review feedback to switch from
group_by() + ungroup()pattern to per-operation grouping with.byparameter throughout the codebase, and document this preference.Changes
update_possible_subj_data.R:group_by("ID")used string literal instead of column referencefit_joint_model.R: Replacedgroup_by() |> summarize(.groups = "drop")andgroup_by() |> mutate() |> ungroup()with.byparameter.bysyntax: All.byparameters use tidy selection with quoted strings (.by = c("ID", "Group")) to avoid R CMD check warnings about undefined global variablesgroup_by,ungroup,group_by_atno longer needed.github/copilot-instructions.md: Documents preference for per-operation grouping with examples and comprehensive explanation of tidy selection vs. data maskingmore-plotwith new dplyr grouping conventionsBefore/After
Tidy Selection vs. Data Masking
The
.byparameter uses tidy selection (likeselect(),rename()) which supports both bare column names and quoted strings. Quoted strings are preferred to avoid R CMD check warnings about undefined global variables. The.data$pronoun is for data masking contexts (likemutate(),filter()expressions), not tidy selection. The copilot instructions now include a comprehensive section explaining this distinction.Conflict Resolution
The
.github/copilot-instructions.mdfile now includes both the comprehensive project documentation from themore-plotbranch (project overview, technology stack, development setup, build/test commands) and the new dplyr grouping conventions, creating a unified instruction file for the repository.References:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.