r - How do I order by row.names in dataframe R语言 排序

 

new_df <- df[ order(row.names(df)), ]


REF:
https://stackoverflow.com/questions/20295787/how-can-i-use-the-row-names-attribute-to-order-the-rows-of-my-dataframe-in-r
https://stackoverflow.com/questions/25194196/how-do-i-order-by-row-names-in-dataframe
posted @ 2023-10-15 09:58  emanlee  阅读(8)  评论(0编辑  收藏  举报