Skip to content

Fix lint issues in report.compare_performance.R - rename variables to avoid object_overwrite_linter warnings#554

Merged
rempsyc merged 2 commits intomainfrom
copilot/fix-553
Sep 9, 2025
Merged

Fix lint issues in report.compare_performance.R - rename variables to avoid object_overwrite_linter warnings#554
rempsyc merged 2 commits intomainfrom
copilot/fix-553

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 9, 2025

Fixed all object_overwrite_linter warnings in R/report.compare_performance.R by renaming variables that conflicted with exported objects from base R packages.

Problem

The development version of lintr was flagging 14 object_overwrite_linter warnings in this file:

  • Variables named table conflicted with base::table()
  • Variables named text conflicted with graphics::text()

Solution

Renamed problematic variables following established codebase patterns:

  • tableresult_table
  • textresult_text

Functions Updated

  • report.compare_performance()
  • report_table.compare_performance()
  • report_statistics.compare_performance()
  • report_parameters.compare_performance()
  • report_text.compare_performance()

Validation

Before: 14 object_overwrite_linter warnings
After: 0 lint issues found ✅

All functionality remains identical - comprehensive testing confirms no regressions:

library(report)
library(performance)

m1 <- lm(Sepal.Length ~ Petal.Length * Species, data = iris)
m2 <- lm(Sepal.Length ~ Petal.Length + Species, data = iris)  
m3 <- lm(Sepal.Length ~ Petal.Length, data = iris)

x <- performance::compare_performance(m1, m2, m3)
report(x)
#> We compared three models; lm (R2 = 0.84, adj. R2 = 0.83, AIC = 106.77, BIC =
#> 127.84, RMSE = 0.33, Sigma = 0.34), lm (R2 = 0.84, adj. R2 = 0.83, AIC =
#> 106.23, BIC = 121.29, RMSE = 0.33, Sigma = 0.34) and lm (R2 = 0.76, adj. R2 =
#> 0.76, AIC = 160.04, BIC = 169.07, RMSE = 0.40, Sigma = 0.41).

Fixes #553.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… avoid object_overwrite_linter warnings

Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
Copilot AI changed the title [WIP] [Copilot]: Fix lint issues in report.compare_performance.R Fix lint issues in report.compare_performance.R - rename variables to avoid object_overwrite_linter warnings Sep 9, 2025
Copilot AI requested a review from rempsyc September 9, 2025 21:01
@rempsyc rempsyc marked this pull request as ready for review September 9, 2025 21:05
@rempsyc rempsyc merged commit f3b8816 into main Sep 9, 2025
25 of 26 checks passed
@rempsyc rempsyc deleted the copilot/fix-553 branch September 9, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Copilot]: Fix lint issues in report.compare_performance.R

2 participants