Skip to content
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

Make our factor dialogs simpler to use #9451

Open
rdstern opened this issue Feb 17, 2025 · 0 comments
Open

Make our factor dialogs simpler to use #9451

rdstern opened this issue Feb 17, 2025 · 0 comments

Comments

@rdstern
Copy link
Collaborator

rdstern commented Feb 17, 2025

Our factor menu is really impressive - that's because one reason why R is so good for data analysis is because of factors.

And forcats is an impressive package for handling factors.

Factors are categorical columns. We need to make using them as simple as possible. Here is an example:

Image

This looks a bit daunting. Notice there are not many variables in the selector, because we only have the factor variables available there. In the example above the corsor is in the Variety variable - which is a factor. So, please could the dialog start with the selected variable in the receiver, if it is a factor. So here the dialog would start as below:

Image

That's clearer. Why not.

I further suggest that if the current variable in the data view (or the metadata view) is not a factor, then the dialog starts with the first factor variable in the selector, copied into the receiver, as shown below.

Image

What is also nice about this scheme, is that occasionally we have data still without factors - and that's often because we have forgotten to make those variable into factors. So now the only reason that the receiver is empty is when there are no factors in the data.

In the factor menu I propose this change (selected variable if a factor pr ordered factor, and first factor otherwise) for the following dialogs that have a single receiver - except 1, namely Unused Levels.

  1. Recode Factor
  2. Dummy Variables
  3. Levels/Labels - this does it nicely from right click already.
  4. Reorder Levels - as shown above
  5. Reference Level
  6. Contrasts
  7. Factor Data Frame

Unused Levels is different. There we check the factors from the selector and fill the receiver with the first factor that has unused levels. If no factors have unused levels then we don't fill the receiver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant