Skip to content

Conversation

@strengejacke
Copy link
Member

Fixes #1116

@strengejacke strengejacke requested a review from Copilot June 26, 2025 12:03
Copy link
Contributor

Copilot AI left a 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 makes standardize = FALSE the default for factor_analysis(), aligning its behavior with the intended breaking change in #1116.

  • Changed the default for standardize in factor_analysis() to FALSE.
  • Updated documentation (man page and roxygen) to reflect the new defaults and added explanatory notes.
  • Adjusted tests, NEWS, and bumped the package version.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/testthat/test-factor_analysis.R Added standardize = TRUE to the existing test to preserve previous behavior.
man/principal_components.Rd Updated usage default for standardize and added a note about PCA vs. FA defaults.
R/principal_components.R Added note in roxygen docs about differing defaults for PCA (TRUE) and FA (FALSE).
R/factor_analysis.R Changed the default standardize argument to FALSE.
NEWS.md Documented the breaking change and bumped the version.
DESCRIPTION Updated package version to 0.26.0.8.
Comments suppressed due to low confidence (3)

man/principal_components.Rd:24

  • The usage section for PCA still shows standardize = FALSE even though principal_components() defaults to TRUE. Please correct the default to match the function behavior or update the function accordingly.
  standardize = FALSE,

tests/testthat/test-factor_analysis.R:44

  • The test covers standardize = TRUE, but there is no test for the new default (standardize = FALSE). Consider adding a test to verify the default behavior.
    standardize = TRUE,

R/factor_analysis.R:15

  • Update the roxygen @param standardize description for factor_analysis() to mention the new default of FALSE, similar to the note added in principal_components.R.
                                       standardize = FALSE,

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 changes the default value of the standardize argument in the factor_analysis() function to FALSE. This is a breaking change, as it alters the function's behavior if the argument is not explicitly specified. The documentation and tests have been updated to reflect this change.

Highlights

  • Breaking Change: The standardize argument in factor_analysis() now defaults to FALSE instead of TRUE.
  • Documentation: Updated documentation in principal_components.R and man/principal_components.Rd to reflect the change in the default value of the standardize argument for factor_analysis() and to clarify its behavior for PCA vs. FA.
  • Tests: Added standardize = TRUE to the factor_analysis test case to ensure the test still passes with the new default.
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

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

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 default value of the standardize argument in the factor_analysis() function to FALSE. It also updates the documentation to reflect this change and adds a note explaining the difference in default values between PCA and FA. A test case was also updated to explicitly set standardize = TRUE.

Comment on lines 34 to 35
#' analysis (in general, such scaling is advisable). **Note:** This defaults
#' to `TRUE` for PCA, but to `FALSE` for FA.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

It would be helpful to provide a brief explanation of why the default value for standardize differs between PCA and FA. This could clarify the rationale for users who might be unfamiliar with the nuances of each analysis.

#'   analysis (in general, such scaling is advisable). **Note:** This defaults
#'   to `TRUE` for PCA (as variables are often on different scales), but to `FALSE` for FA (where variables are assumed to be on a similar scale).

n = 2,
rotation = "oblimin",
threshold = "max",
standardize = TRUE,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Since the default value of standardize is now FALSE, explicitly setting it to TRUE in this test ensures that the test still covers the case where standardization is applied. This is good practice to maintain test coverage.

   standardize = TRUE,

@strengejacke strengejacke merged commit 0b785e2 into main Jun 26, 2025
16 of 23 checks passed
@strengejacke strengejacke deleted the strengejacke/issue1116 branch June 26, 2025 14:11
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.

Make standardize = FALSE the default for factor_analysis()

2 participants