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

fct_recode() with vectors of length > 1 #56

Closed
krlmlr opened this issue Nov 14, 2016 · 3 comments
Closed

fct_recode() with vectors of length > 1 #56

krlmlr opened this issue Nov 14, 2016 · 3 comments

Comments

@krlmlr
Copy link
Member

@krlmlr krlmlr commented Nov 14, 2016

Is this behavior intended? It's not documented in the examples.

fct_recode(letters, "vowel" = c("a", "e", "i", "o", "u"))
##  [1] vowel1 b      c      d      vowel2 f      g      h      vowel3 j      k      l     
## [13] m      n      vowel4 p      q      r      s      t      vowel5 v      w      x     
## [25] y      z     
## Levels: vowel1 b c d vowel2 f g h vowel3 j k l m n vowel4 p q r s t vowel5 v w x y z

If not, we should warn/throw, and perhaps direct the user to fct_collapse().

@hadley hadley closed this in 75ac09a Dec 30, 2016
@azankl
Copy link

@azankl azankl commented Sep 6, 2018

This now throws an error, but the error message does not mention that fct_collapse() could probably do what the user wants. Should this be added?

@krlmlr
Copy link
Member Author

@krlmlr krlmlr commented Sep 28, 2018

Yeah, the help pages of fct_recode() and fct_collapse() could use some love. I'm not sure if the error message should mention this -- only if fct_collapse() is the only possible interpretation of the user's intention.

@krlmlr
Copy link
Member Author

@krlmlr krlmlr commented Sep 28, 2018

Would you like to contribute a PR?

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

Successfully merging a pull request may close this issue.

None yet
2 participants