【发布时间】:2018-09-07 07:27:45
【问题描述】:
我有一堆文件(数量不断增长), 每个文件都应该有一个单独的数据框。
为了简化阅读,我想使用循环来阅读所有文件。 新数据框应以“文件名”中的字符串命名
在最后一行我想创建一个数据框,新数据框的名称应该是“文件名”的内容。
for(x in 1:nrow(Namen)) # creation of the loop
{
Filename<- Namen[x,1] #Takes the Filename from the the DF
einlesepfad <- "path for reading the xlsm files"
einlesepfad <- paste(einlesepfad,Filename,".xlsm", sep="") # creation of the path to read the xlsm file
Filename <- read_excel(einlesepfad) #The Content of "Filename" should be the Name of the new data frame
}
【问题讨论】:
-
请澄清您的问题。看看here 如何创建一个最小的工作示例。