我有多个.txt文件,我想导入到R中的同一对象中。但是,每个文件都位于不同的文件夹中。当我运行下面的代码时,它生成一个矩阵。如何进入物体?
library(readtext)
processFile <- function(f) {
df <- readtext(f)
}
text.files <- list.files(path=training_folder, recursive=T, pattern="*.txt", full.names = T)
result <- sapply(text.files, processFile)