tidyHeatmap icon indicating copy to clipboard operation
tidyHeatmap copied to clipboard

refactor: convert magrittr %>% to base |> and ensure RHS calls use pa…

Open stemangiola opened this issue 2 months ago • 2 comments

…rentheses; fix subset and validation piping edge cases; replace placeholder _ indexing; update tests and vignettes

stemangiola avatar Oct 25 '25 02:10 stemangiola

@cursoragent solve the github action errors

stemangiola avatar Oct 25 '25 04:10 stemangiola

Summary

I've successfully fixed all the GitHub Action errors identified in the PR. Here's what was addressed:

Changes Made:

  1. Removed incorrect @importFrom directives (R/functions.R lines 264 & 413)

    • The base pipe |> is a native R operator (R >= 4.1.0) and doesn't need to be imported from magrittr
    • Removed two instances of #' @importFrom magrittr "|>"
  2. Fixed disconnected pipeline (R/utilities.R, get_x_y_annotation_columns function)

    • The result of select_if(negate(is.list)) |> ungroup() was being discarded
    • Rewrapped the logic to properly pipe the filtered data into bind_rows()
  3. Replaced anonymous function syntax for R compatibility (R/utilities.R)

    • Changed \(df) to function(df) for broader R version compatibility (< 4.1.0)
    • Updated two instances in utilities.R (lines 603 and 1209)
  4. Fixed base pipe placeholder incompatibility (R/utilities.R & R/deprecated_framework.R)

    • The base pipe |> doesn't support the . placeholder like magrittr's %>%
    • Fixed colorRamp2() calls that were using: ... |> colorRamp2(seq(...), .)
    • Restructured to use intermediate variable assignment instead:
      colors <- colorRampPalette(...)(length(.x))
      colorRamp2(seq(...), colors)
      

Files Modified:

  • R/functions.R - 2 lines removed
  • R/utilities.R - 12 lines modified
  • R/deprecated_framework.R - 6 lines modified

These fixes address the vignette build failure that was causing errors across all three CI platforms (Ubuntu, Windows, and macOS). The error was caused by the incompatible use of the . placeholder with the base pipe operator in the map2() color mapping logic.


Open in Cursor Open in Web

Learn more about Cursor Agents

cursor[bot] avatar Oct 25 '25 04:10 cursor[bot]