apply function to certain columns of all dataframe in list and then assign value to columns
问题 Similar question is answered here I have a list of data frames (i.e. 1000) that looks like this: > lst[1000] $rand1000 Binomial S4 S5 S6 254 Euastacus suttoni 25.816165 4.1916527 86.3 327 Orconectes hobbsi 16.726409 5.5241308 25.0 282 Faxonella creaseri 17.026970 6.4109494 18.0 319 Orconectes durelli 14.093957 7.2342324 35.0 525 Procambarus raneyi 15.799001 6.3746574 55.1 I want to apply function to S4, S5 and S6 columns for all data frames in the list. So I wrote this function: lapply(lst,