How to sort data by column in descending order in R

前端 未结 1 1100
暖寄归人
暖寄归人 2020-12-17 20:00

I\'ve looked and looked and the answer either does not work for me, or it\'s far too complex and unnecessary.

I have data, it can be any data, here is an example

相关标签:
1条回答
  • 2020-12-17 20:34

    You need to use dataframe name as prefix

    chickens[order(chickens$feathers),]  
    

    To change the order, the function has decreasing argument

    chickens[order(chickens$feathers, decreasing = TRUE),]  
    
    0 讨论(0)
提交回复
热议问题