In R, if I have one folder called "main" which has 10 subfolders called from A,B,C...J, each sub folder has a .txt file, sub folder A has a 1.txt, subfolder B has a 2.txt, how can I read all this file without typing the name of each file ?
I used this code
data.path="C:/file/path/main"
files=list.files(path=data.path, recursive =T, pattern = "*.txt")
read_file= read.delim(files,header = TRUE, sep = "")
and this message appeared : No such file or directory
question from:
https://stackoverflow.com/questions/65643702/how-to-read-one-file-from-multiple-folders 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…