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

Feature Request: handle ordered factors within as_factor() #216

Open
charliejhadley opened this issue Oct 16, 2019 · 2 comments · Fixed by #237
Open

Feature Request: handle ordered factors within as_factor() #216

charliejhadley opened this issue Oct 16, 2019 · 2 comments · Fixed by #237
Labels
feature a feature request or enhancement

Comments

@charliejhadley
Copy link

charliejhadley commented Oct 16, 2019

Currently, there is not a way to convert an "ordered" "factor" into a plain "factor" within {forcats}.

Hadley requested that PR #215 (comment) be converted into an issue. For easy reading, here's the comment:

Based on our current understanding of S3, I think it's clear that these functions should be as.factor() and as.ordered(). as.ordered() works currently, but as.factor() does not. We can't fix as.factor(), but we can fix as_factor(). Doing that 100% correctly is a bit fiddly, so would you mind filing an issue?

@hadley hadley added feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day labels Jan 21, 2020
@hadley
Copy link
Member

hadley commented Jan 21, 2020

To fix this as_factor.factor() should construct a new factor from first principles, using only selected attributes from x. Will also need a test to verify that attributes are stripped.

@hadley
Copy link
Member

hadley commented Feb 29, 2020

Reopening because fixing this breaks haven in a minor way, and a haven fix is complicated.

@hadley hadley reopened this Feb 29, 2020
@hadley hadley removed the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants