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

sjmisc::rec generated factors not in the expected order #154

Open
Rick-Chen-PKU opened this issue Oct 9, 2023 · 0 comments
Open

sjmisc::rec generated factors not in the expected order #154

Rick-Chen-PKU opened this issue Oct 9, 2023 · 0 comments

Comments

@Rick-Chen-PKU
Copy link

d = tibble(x = c(1,2,3,4))
d <- d %>% mutate(x = rec(x, rec="1=YES;2=No;3=Me;4=He", as.num = F, append = T) )
d$x

Hi, I did a simple test as shown in the code above. I want the order of the generated factors to be "Yes No Me He", but the order of the above result is "He Me No YES". Is there any parameter that can be utilized to make the factor in the desired order?

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

No branches or pull requests

1 participant