You could use the plain apply
function with MARGIN = 1
to apply over rows and then transpose the result.
t(apply(df, 1, sort))
More Related Contents:
- Sort (order) data frame rows by multiple columns
- How to sort a character vector where elements contain letters and numbers in R?
- Order data frame rows according to vector with specific order
- Reorder levels of a factor without changing order of values
- Order a “mixed” vector (numbers with letters)
- How does one reorder columns in a data frame?
- Understanding the order() function
- How to perform natural (lexicographic) sorting in R? [duplicate]
- How to quickly form groups (quartiles, deciles, etc) by ordering column(s) in a data frame
- Merge two data frames while keeping the original row order
- rank and order in R
- Custom sorting (non-alphabetical)
- How to sort letters in a string?
- How to sort a character vector where elements contain letters and numbers?
- Sort columns of a dataframe by column name
- Pass a vector of variable names to arrange() in dplyr
- What are the R sorting rules of character vectors?
- How to sort a data frame in R
- Re-ordering bars in R’s barplot()
- How to sort a data frame by date
- How to get top n companies from a data frame in decreasing order
- Sort year-month column by year AND month
- Sorting rows alphabetically
- Find K nearest neighbors, starting from a distance matrix
- How to sort all dataframes in a list of dataframes on the same column?
- How to reverse order a vector?
- How to order my dataframe lexicographicaly
- Row-wise sort then concatenate across specific columns of data frame
- Move NAs to the end of each column in a data frame
- How can I add hatches, stripes or another pattern or texture to a barplot in ggplot?