Skip to content

Harden CLD fallback paths to prevent R-CMD-check failure when multcompView is unavailable - #2

Merged
PALP31 merged 2 commits into
mainfrom
copilot/fix-r-cmd-check-failure
Aug 15, 2026
Merged

Harden CLD fallback paths to prevent R-CMD-check failure when multcompView is unavailable#2
PALP31 merged 2 commits into
mainfrom
copilot/fix-r-cmd-check-failure

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

R-CMD-check failed in CI because CLD generation (multcomp::cld) could fail when multcompView was unavailable, which removed expected grouping output and broke test-tablas-graficos.R. This PR makes CLD-dependent paths degrade safely while preserving stable output shape.

  • Post-hoc fallback stability (R/posthoc_emmeans.R)

    • Gate CLD execution on both multcomp and multcompView.
    • On CLD unavailability/failure, return EMMeans summary fallback without emitting hard failure.
    • Guarantee a Grupo column exists in fallback output (NA_character_) so downstream exporters/tests have consistent schema.
  • Prediction plot CLD resilience (R/graficar_predichos.R)

    • Use the same dual dependency gate (multcomp + multcompView) before attempting CLD labels.
    • Skip CLD label merge silently when unavailable, preserving plot generation for mostrar_letras = TRUE.
  • Regression coverage (tests/testthat/test-tablas-graficos.R)

    • Added focused tests that mock missing CLD dependencies and assert:
      • obtener_posthoc(..., letras = TRUE) still returns Grupo.
      • graficar_predichos(..., mostrar_letras = TRUE) still returns a ggplot without warning.

Example of the new fallback contract:

ph <- obtener_posthoc(m, "Species", letras = TRUE)
# If CLD deps are unavailable:
# - ph is still a data.frame
# - "Grupo" is always present (NA fallback)
"Grupo" %in% names(ph)

Co-authored-by: PALP31 <180587161+PALP31@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions job R-CMD-check Harden CLD fallback paths to prevent R-CMD-check failure when multcompView is unavailable Aug 15, 2026
Copilot AI requested a review from PALP31 August 15, 2026 03:21
@PALP31
PALP31 marked this pull request as ready for review August 15, 2026 03:22
Copilot AI lite review requested due to automatic review settings August 15, 2026 03:22
@PALP31
PALP31 merged commit 1164c4e into main Aug 15, 2026
1 check failed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens Compact Letter Display (CLD) generation paths so CI (R-CMD-check) does not fail when multcompView is unavailable, while keeping downstream output/plot shapes stable.

Changes:

  • Guard CLD execution behind a dual dependency check (multcomp + multcompView) and fall back safely when unavailable.
  • Ensure post-hoc outputs always include a stable Grupo column (with NA_character_ fallback) to avoid schema breaks.
  • Add regression tests that mock missing CLD dependencies and assert stable behavior for obtener_posthoc() and graficar_predichos().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
R/posthoc_emmeans.R Adds dual dependency gating for CLD and guarantees a Grupo column in fallback output.
R/graficar_predichos.R Adds dual dependency gating for CLD labels so plots still render when CLD deps are missing.
tests/testthat/test-tablas-graficos.R Adds tests to cover CLD dependency-missing fallbacks and output stability.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread R/graficar_predichos.R
Comment on lines +82 to +84
}, error = function(e) {
NULL
})
Comment thread R/posthoc_emmeans.R
Comment on lines +104 to +106
}, error = function(e) {
NULL
})
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.

3 participants