refactor: convert magrittr %>% to base |> and ensure RHS calls use pa…
…rentheses; fix subset and validation piping edge cases; replace placeholder _ indexing; update tests and vignettes
@cursoragent solve the github action errors
Summary
I've successfully fixed all the GitHub Action errors identified in the PR. Here's what was addressed:
Changes Made:
-
Removed incorrect
@importFromdirectives (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 "|>"
- The base pipe
-
Fixed disconnected pipeline (R/utilities.R,
get_x_y_annotation_columnsfunction)- The result of
select_if(negate(is.list)) |> ungroup()was being discarded - Rewrapped the logic to properly pipe the filtered data into
bind_rows()
- The result of
-
Replaced anonymous function syntax for R compatibility (R/utilities.R)
- Changed
\(df)tofunction(df)for broader R version compatibility (< 4.1.0) - Updated two instances in utilities.R (lines 603 and 1209)
- Changed
-
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)
- The base pipe
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.
Learn more about Cursor Agents