Answers for "sort a dataframe by a column in r"

C
2

r sort data frame by one column

population[order(population$age),]
Posted by: Guest on August-19-2020
1

sort dataframe r

df %>% arrange(column)
Posted by: Guest on February-27-2021
1

sort in descending order in r

#sort by mpg (ascending) and cyl (descending)
newdata <- mtcars[order(mpg, -cyl),]
Posted by: Guest on September-09-2020

Code answers related to "sort a dataframe by a column in r"

Code answers related to "C"

Browse Popular Code Answers by Language