Given data:
library(data.table)
DT = data.table(category=LETTERS[1:3], b=1:3)
DT
# category b
# 1: A 1
# 2: B 2
# 3: C 3
Using dplyr
, how to rearrange rows to get specific order c("C", "A", "B")
in category
?
# category b
# 1: C 3
# 2: A 1
# 3: B 2
See Question&Answers more detail:os