-
-
Notifications
You must be signed in to change notification settings - Fork 100
Suggestions for various scale item functions #837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @strengejacke, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily focuses on extending the check_itemscale()
function within the performance
package. The core enhancement allows the function to process outputs from factor analysis, providing a more versatile tool for researchers to evaluate the internal consistency of scales and subscales in psychometric contexts. This change addresses issue #836.
Highlights
- Functionality Extension: The
check_itemscale()
function has been significantly enhanced to accept results fromparameters::factor_analysis()
(objects of classparameters_efa
), in addition to the previously supportedparameters::principal_components()
(objects of classparameters_pca
). This broadens its applicability for assessing internal consistencies of subscales derived from factor analysis. - Documentation Updates: All relevant documentation, including the Roxygen comments within the source code and the auto-generated R documentation, has been updated to reflect the new support for
parameters_efa
objects andparameters::factor_analysis()
.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request modifies the check_itemscale
function to support factor analysis results from parameters::factor_analysis()
in addition to principal component analysis results. The changes include updating the function description, parameter definitions, and error handling to accommodate the new input type. The code was reviewed and suggestions were made to improve error message clarity and code efficiency.
@gemini-code-assist review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request enhances check_itemscale()
and item_omega()
by adding support for factor analysis objects and on-the-fly item reversal. The changes are well-documented and include tests. A critical issue was identified in R/item_omega.R
where a function signature change was not fully propagated, which will cause runtime errors. Additionally, medium-severity issues were noted regarding broken documentation links and code duplication.
@gemini-code-assist review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the check_itemscale()
function to work with parameters::factor_analysis()
outputs, updates the Markdown printer to include Cronbach’s alpha and inter-item correlation footers, and removes the deprecated item_direction
parameter from item_omega()
. It also adds new tests (and snapshots) covering the FA path, updates documentation, and bumps the package version.
- Support FA objects in
check_itemscale()
(code + docs) - Extend
print_md()
forcheck_itemscale()
with footers and new snapshots - Remove
item_direction
parameter fromitem_omega()
and update its documentation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/testthat/test-model_performance.psych.R | Add rotation = "none" to psych test |
tests/testthat/test-check_itemscale.R | Add skips and new FA tests for check_itemscale() |
tests/testthat/_snaps/check_itemscale.md | New snapshot for FA print_md() |
man/item_omega.Rd | Remove item_direction argument documentation |
man/check_itemscale.Rd | Update docs to include factor_analysis() ; fix Rd syntax |
R/print_md.R | Refactor print_md.check_itemscale() to generate captions & footers |
R/item_omega.R | Remove item_direction from code |
R/check_itemscale.R | Add parameters_efa to code path and simplify checks |
NEWS.md | Document new FA support and footer feature |
DESCRIPTION | Bump version to 0.14.0.11 |
Comments suppressed due to low confidence (2)
tests/testthat/test-model_performance.psych.R:6
- [nitpick] Add skip_if_not_installed("psych") and skip_if_not_installed("GPArotation") at the top of this test to avoid failures when those packages are not available.
test_that("model_performance.psych", {
man/check_itemscale.Rd:11
- The
\item{x}
block is split incorrectly and the cross‐reference forfactor_analysis()
uses the wrong Rd topic. Merge into a single\item{x}{...}
entry and use\link[parameters:factor_analysis]{parameters::factor_analysis()}
for the FA reference.
\code{\link[parameters:principal_components]{parameters::principal_components()}}, of class \code{parameters_efa}, as
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request enhances check_itemscale()
to support factor analysis results. The review identifies an issue in the generated documentation where a link to parameters::factor_analysis()
is incorrect.
man/check_itemscale.Rd
Outdated
\code{\link[parameters:principal_components]{parameters::principal_components()}}, of class \code{parameters_efa}, as | ||
returned by \code{\link[parameters:principal_components]{parameters::factor_analysis()}}, or a data frame.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link for parameters::factor_analysis()
is incorrect. It points to parameters::principal_components
instead of parameters::factor_analysis
.
\code{\link[parameters:factor_analysis]{parameters::factor_analysis()}}, of class \code{parameters_efa}, as
returned by \code{\link[parameters:factor_analysis]{parameters::factor_analysis()}}, or a data frame.
man/check_itemscale.Rd
Outdated
of \code{\link[parameters:principal_components]{parameters::principal_components()}} or | ||
\code{\link[parameters:principal_components]{parameters::factor_analysis()}}, i.e. based on how many components were |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link for parameters::factor_analysis()
is incorrect. It points to parameters::principal_components
instead of parameters::factor_analysis
.
\code{\link[parameters:factor_analysis]{parameters::factor_analysis()}} or
\code{\link[parameters:factor_analysis]{parameters::factor_analysis()}}, i.e. based on how many components were
Fixes #836