sorting dataframe by column
population[order(population$age),] #ascending population[order(-population$age),] #descending ###Dplyr df %>% arrange(desc(col1)) df %>% arrange(col1)