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

Fix arrange() with character vectors #99

Merged

Conversation

etiennebacher
Copy link
Contributor

Close #85

df <- data.frame(x = head(letters), stringsAsFactors = FALSE)
poorman::arrange(df, -x)
#>   x
#> 6 f
#> 5 e
#> 4 d
#> 3 c
#> 2 b
#> 1 a

set.seed(2022)
df <- data.frame(
  x = sample(c("A", "B"), 6, replace = TRUE),
  y = 1:6
)
df
#>   x y
#> 1 B 1
#> 2 A 2
#> 3 B 3
#> 4 A 4
#> 5 A 5
#> 6 B 6
poorman::arrange(df, -x, y)
#>   x y
#> 1 B 1
#> 3 B 3
#> 6 B 6
#> 2 A 2
#> 4 A 4
#> 5 A 5

Created on 2022-07-28 by the reprex package (v2.0.1)

@nathaneastwood nathaneastwood merged commit fa963fe into nathaneastwood:master Jul 31, 2022
@etiennebacher etiennebacher deleted the fix_arrange_character branch October 25, 2022 11:52
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

Successfully merging this pull request may close these issues.

arrange() doesn't work for descending character vectors
2 participants