I have a dataframe and one of the variables is a list. I want each of the vectors in the list to be alphabetically ordered.
[1] D,F should become F,D
[2] B,D,C should become B,C,D
and so on with each row
I have tried DF$variableC<-lapply(DF$variable, sort) but nothing happens, the variable remains exactly the same
One base R approach would be to split the CSV input string into a list, sort that list, then paste collapse back to CSV.