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.
More Related Contents:
- Is R’s apply family more than syntactic sugar?
- Order data frame rows according to vector with specific order
- Order a “mixed” vector (numbers with letters)
- Understanding the order() function
- Faster way to read fixed-width files
- R Apply() function on specific dataframe columns
- Concatenate row-wise across specific columns of dataframe
- Custom sorting (non-alphabetical)
- How to sort a character vector where elements contain letters and numbers?
- Sort columns of a dataframe by column name
- What are the R sorting rules of character vectors?
- Apply a function to every row of a matrix or a data frame
- Is there a R function that applies a function to each pair of columns?
- How to sort a data frame in R
- Why apply() returns a transposed xts matrix?
- How to paste a string on each element of a vector of strings using apply in R?
- Why does as.factor return a character when used inside apply?
- apply a function over groups of columns
- rbind data frames based on a common pattern in data frame name
- Dataframe create new column based on other columns
- How to get top n companies from a data frame in decreasing order
- Calculate row-wise proportions
- Last Observation Carried Forward In a data frame? [duplicate]
- 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?
- use multiple columns as variables with sapply
- Row-wise sort then concatenate across specific columns of data frame
- Apply function to each column in a data frame observing each columns existing data type
- how to access global/outer scope variable from R apply function?