-1

I would like to reorder this dataframe based on the values โ€‹โ€‹of the "new" column, how can I do? tell me the exact formula, thanks

enter image description here

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • Welcome to SO, Nabboitaliae! Two things, please: (1) Please do not post an image of code/data/errors: it breaks screen-readers and it cannot be copied or searched (ref: https://meta.stackoverflow.com/a/285557 and https://xkcd.com/2116/). Please just include the code, console output, or data (e.g., `data.frame(...)` or the output from `dput(head(x))`) directly. โ€“ r2evans Feb 02 '22 at 22:39

1 Answers1

0

Substituting "DF" as your data frame, you can use this line of code:

DF[order(DF$new), ]

If you just wanted to view the data frame sorted, you can use

View(DF)

And click the arrows on the column name, which automatically sorts the data frame by ascending/descending.

typhatypha
  • 16
  • 1