I have a data frame with 348 numeric columns and I would like to put all these columns in ascending order. How to do this? I tried some codes that sorted the first column in ascending order. I want them all in ascending order. Exemple:
a1 = runif(n = 50, min = 0.1, max = 120)
a2 = runif(n = 50, min = 5, max = 151)
a3 = runif(n = 50, min = 1, max = 100)
a4 = runif(n = 50, min = 6, max = 180)
a5 = runif(n = 50, min = 6, max = 183)
a6 = runif(n = 50, min = 6, max = 254)
df = data.frame(a1,a2,a3,a4,a5,a6)
df
df2 = df[with(df, order(a1,a2,a3,a4,a5,a6)), ]
head(df2)
df2 with the first column in ascending order but I want them all (a1:a6 in ascending order)