04pallav
9/13/2017 - 9:26 PM

sorting dataframe by column

sorting dataframe by column

population[order(population$age),] #ascending
population[order(-population$age),] #descending


###Dplyr

df %>% arrange(desc(col1))
df %>% arrange(col1)