Sorting rows alphabetically

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.

Leave a Comment