with two or more dataframes, df1, df2, df3, df4, ...
what data structure should be used such that it is possible to iterate through the dataframes and do something with each.
for(df in 'what') {
print(colnames(df))
}
the what
part - which data structure to be used so that each dataframe can be accessed to do something with it in side the for
loop.
通常,最好将数据包含在列表中,而不要在全局环境中使用单独的数据框。将数据保存在列表中更易于管理。
and use
lapply
to do something on each one of it.