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
dataframes_list
dput(dataframes_list)
lapply is your friend ;)
You could do it using arrange from dplyr pacakge like this:
library(dplyr) newlist <- lapply(dataframeslist, function(df){arrange(df,enrichment)})
or without dplyr like this:
newlist <- lapply(dataframeslist, function(df){df[order(df$enrichment),]})