Skip to content

Fix undefined table parameter in report_effectsize.htest() - #510

Merged
rempsyc merged 6 commits into
mainfrom
copilot/fix-459
Sep 22, 2025
Merged

rempsyc merged 6 commits into
mainfrom
copilot/fix-459

Conversation

Copilot AI commented Aug 31, 2025

Copy link
Copy Markdown
Contributor
  • Fix undefined table parameter in report_effectsize.htest()
  • Remove undefined table parameter from all internal effectsize function calls
  • Update function signatures for all internal effectsize functions
  • Fix variable references in .report_effectsize_correlation() function
  • Verify all htest effectsize functions work correctly (t-test, correlation, chi-squared)
  • All tests pass including test-report.htest-correlation.R
  • Fix all package lints using config file (object overwrite linter)

Linting Fixes

Fixed all object_overwrite_linter warnings by renaming local table variables in the internal effectsize functions to avoid overwriting base::table:

Changes made:

  • R/report_htest_chi2.R: Renamed tablees_table and result_table
  • R/report_htest_cor.R: Renamed tableresult_table
  • R/report_htest_fisher.R: Renamed tablees_table and result_table
  • R/report_htest_ttest.R: Renamed tablees_table and result_table
  • R/report_htest_wilcox.R: Renamed tablewilcox_table and result_table

All htest effectsize functions continue to work correctly and all tests pass. The only remaining lint warnings are for missing suggested packages in vignettes (dplyr, lme4), which is expected in development environments.


💡 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.

Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>
Copilot AI changed the title [WIP] .report_effectsize_ttest called without proper table Fix undefined table parameter in report_effectsize.htest() Aug 31, 2025
Copilot AI requested a review from rempsyc August 31, 2025 05:27
@rempsyc

rempsyc commented Sep 22, 2025

Copy link
Copy Markdown
Member

@copilot test-report.htest-correlation.R is failing

── Error (test-report.htest-correlation.R:3:3): report.htest-correlation ───────
<notSubsettableError/error/condition>
Error in `table[[estimate]]`: object of type 'closure' is not subsettable
Backtrace:1. ├─report::report(cor.test(iris$Sepal.Width, iris$Sepal.Length)) at test-report.htest-correlation.R:3:3
 2. └─report:::report.htest(cor.test(iris$Sepal.Width, iris$Sepal.Length)) at report/R/report.R:101:3
 3.   ├─report::report_table(x, model_info = model_info, ...) at report/R/report.htest.R:29:3
 4.   └─report:::report_table.htest(x, model_info = model_info, ...) at report/R/report_table.R:62:3
 5.     ├─base::do.call(report_effectsize, call_args) at report/R/report.htest.R:150:3
 6.     ├─report (local) `<fn>`(`<htest>`, table = `<prmtrs_m[,11]>`, model_info = `<named list>`)
 7.     └─report:::report_effectsize.htest(...) at report/R/report_effectsize.R:43:3
 8.       └─report:::.report_effectsize_correlation(x, dot_args) at report/R/report.htest.R:95:5
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]

Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>

Copilot AI commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot test-report.htest-correlation.R is failing

...

Fixed in commit a288c04. The issue was that in .report_effectsize_correlation(), references to the removed table parameter weren't updated to use cor_table. The function was trying to access base::table() instead of the correlation results. All correlation tests now pass.

@rempsyc

rempsyc commented Sep 22, 2025

Copy link
Copy Markdown
Member

@copilot thanks can you also fix all package lints (use config file at root including object overwrite linter)

Co-authored-by: rempsyc <13123390+rempsyc@users.noreply.github.com>

Copilot AI commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot thanks can you also fix all package lints (use config file at root including object overwrite linter)

Fixed in commit 9752938. All object_overwrite_linter warnings have been resolved by renaming local table variables in the internal effectsize functions to avoid overwriting base::table. The only remaining lint warnings are for missing suggested packages in vignettes (expected in development environments). All tests continue to pass.

@rempsyc
rempsyc marked this pull request as ready for review September 22, 2025 01:44
@rempsyc rempsyc linked an issue Sep 22, 2025 that may be closed by this pull request
@rempsyc
rempsyc merged commit 3927f2b into main Sep 22, 2025
29 of 52 checks passed
@rempsyc
rempsyc deleted the copilot/fix-459 branch September 22, 2025 02:13
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.

.report_effectsize_ttest called without proper table

2 participants