How to sort all dataframes in a list of dataframes on the same column?

后端 未结 3 1491
后悔当初
后悔当初 2020-12-06 13:25

I have a list of dataframes dataframes_list. For an example, I put the dput(dataframes_list) at the bottom. I want to sort all dataframes in the li

3条回答
  •  悲&欢浪女
    2020-12-06 14:07

    Use lapply:

    sorted_dataframes_list <- lapply(dataframes_list, function(df){
                                     df[order(df$enrichment),]
                                     })
    

提交回复
热议问题