Skip to content

Allow character grouping columns in factor smooths - #293

Draft
stemangiola with Copilot wants to merge 6 commits into
masterfrom
copilot/fix-smooth-grouping-issue
Draft

Allow character grouping columns in factor smooths#293
stemangiola with Copilot wants to merge 6 commits into
masterfrom
copilot/fix-smooth-grouping-issue

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

mgcv factor smooths (bs = "fs") require grouping variables to be factors, but character columns caused smooth construction errors.

  • Internal coercion: Convert character variables used by bs = "fs" smooth terms to factors before calling mgcv::smoothCon().
  • Regression coverage: Add a unit test for character grouping input.
data <- data.frame(
  x = seq(0, 6, length.out = 24),
  tissue = rep(c("blood", "lymph", "tumor"), length.out = 24)
)

parse_formula_smooths(~ s(x, tissue, bs = "fs", k = 5), data)

Copilot AI and others added 5 commits August 7, 2026 02:27
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Co-authored-by: stemangiola <7232890+stemangiola@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix smooth grouping to allow character input without errors Allow character grouping columns in factor smooths Aug 7, 2026
Copilot AI requested a review from stemangiola August 7, 2026 02:30
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.

smooth grouping should be a factor now, can we open it to be a character without causing error?

2 participants