Skip to content

fix: import %||% from rlang for R < 4.4 - #401

Open
mhovd wants to merge 1 commit into
mainfrom
claude/pmetrics-pmcore-pharmsol-fixes-qdno6d-null-coalesce
Open

mhovd wants to merge 1 commit into
mainfrom
claude/pmetrics-pmcore-pharmsol-fixes-qdno6d-null-coalesce

Conversation

@mhovd

@mhovd mhovd commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Bug. On R < 4.4, the plotting helpers (for example the covariate plot) fail with could not find function "%||%". Base R only has %||% from 4.4.

Fix. Import %||% from rlang (@importFrom rlang %||%). Tested on R 4.3.3: NPex$cov$plot(v ~ wt) fails on main and works with this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GTyUgJEd5uCEmv9qYrv8dC


Generated by Claude Code

%||% is only in base R from 4.4, so the plotting helpers failed on R 4.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GTyUgJEd5uCEmv9qYrv8dC
Copilot AI balanced review requested due to automatic review settings October 11, 2026 10:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The targeted import consistently fixes the missing operator on older supported R versions.

0 open findings

What changed in this PR

Imports rlang’s %||% operator to restore plotting compatibility with R versions before 4.4.

Changes:

  • Adds %||% to the rlang roxygen imports.
  • Updates the generated namespace accordingly.
File Description
R/​Pmetrics-package.R Declares the `%
NAMESPACE Registers `%

🧠 Review effort: Balanced


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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.77%. Comparing base (ef474a1) to head (9501ecd).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #401   +/-   ##
=======================================
  Coverage   64.77%   64.77%           
=======================================
  Files          52       52           
  Lines       22964    22964           
=======================================
  Hits        14876    14876           
  Misses       8088     8088           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

4 participants