Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含数百个 CSV 文件的文件夹。使用 R 将这些转换为 XLS 格式的最简单方法是什么?
(是的,我知道 CSV 与 Excel 兼容,但我仍然有充分的理由转换它们。)
使用包xlsReadWrite导出到 xls:
xlsReadWrite
library(xlsReadWrite) filenames <- list.files("[path_name]", pattern="*.csv", full.names=TRUE) for(i in 1:length(filenames)){ a <- read.csv(filenames[i]) write.xls(a, paste("file",i,".xls", sep="")) }