I have a list of 12000 elements. I want to add a column to each element in which the column name/number is displayed with a minimum of 6 row values. I can do this for a single element, but unfortunately not in a way that it works for all list elements.
Here is my code so far:
l2<-lapply(adresults_df_list, function(x)
cbind(x, bf = NA))
for(i in 1:12000){
adresults_df_list[[i]]$bf <- apply(adresults_df_list[[i]][,1:6], 1, function(x) which(x==min(x)))
}
Mayby I can do this with lapply or a loop?