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
Close #85
Created on 2022-07-28 by the reprex package (v2.0.1)