【发布时间】:2021-01-19 16:01:34
【问题描述】:
我有 65 个 excel 文件存储在一个文件夹中(即 JanuaryFiles)。我需要:
- 导入每个 excel 文件,2) 用特定名称重命名列(所有 65 个文件应具有相同的列名),3) 使用任何函数(例如 rbind())将 65 个文件合并到一个文件中,以及4) 用今天的日期命名。
我用过:
mydir = setwd("~/Dropbox/JanuaryFiles")
myfiles = list.files(path=mydir, pattern="*.xlsx", full.names=TRUE)
myfiles
# Here: I need to rename the columns of each excel file:
# Then I used the following to combine the files:
combined.df <- do.call(cbind , dat_All)
# I'm also still missing the function that names the final file with specific name and today's date.
【问题讨论】: