My data looks like,
A B C D B C A D X Y M Z O M L P
How can I sort the rows to get something like
A B C D A B C D M X Y Z L M O P
Thanks,
t(apply(DF, 1, sort))
The t() function is necessary because row operations with the apply family of functions returns the results in column-major order.
t()
apply
1.4m articles
1.4m replys
5 comments
57.0k users