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

inner_join on grouped_df loses factor level order #675

Closed
wch opened this issue Oct 9, 2014 · 0 comments
Closed

inner_join on grouped_df loses factor level order #675

wch opened this issue Oct 9, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@wch
Copy link
Member

@wch wch commented Oct 9, 2014

Example:

input <- data.frame(g1 = factor(c('A','B','C'), levels = c('B','A','C')))
output <- data.frame(
  g1 = factor(c('A','B','C'), levels = c('B','A','C')),
  g2 = factor(c('A','B','C'), levels = c('B','A','C'))
)

res <- inner_join(group_by(input, g1), group_by(output, g1))
levels(res$g1)
# [1] "A" "B" "C"
levels(res$g2)
# [1] "B" "A" "C"

They both should be "B" "A" "C".

@romainfrancois romainfrancois added this to the 0.3.1 milestone Oct 13, 2014
@romainfrancois romainfrancois self-assigned this Oct 13, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants