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

Comments

Projects
None yet
2 participants
@krlmlr
Copy link
Member

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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