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

change sparse argument of step_dummy() to be an enum #1407

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

EmilHvitfeldt
Copy link
Member

to close #1396

R/dummy.R Outdated
@@ -301,7 +302,7 @@ bake.step_dummy <- function(object, new_data, ...) {
ordered = is_ordered
)

if (object$sparse) {
if (object$sparse == "yes") {
current_contrast <- getOption("contrasts")[is_ordered + 1]
if (current_contrast != "contr.treatment") {
Copy link
Member

Choose a reason for hiding this comment

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

Would it work with contr_one_hot()?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct, has been fixed

@EmilHvitfeldt EmilHvitfeldt merged commit 2326e71 into main Jan 13, 2025
13 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the steo_dummy-soarse-enum branch January 13, 2025 22:32
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

have sparse argument in step_dummy() be a enum instead of a logical
2 participants