I have a folder with about 100 file txt. I only run simpl code:
> setwd("E:/Yunlin/SMUNPO/TXTFILE/")
> filenames <- list.files(getwd(),pattern="*.txt")
> textfiles <- lapply(filenames, readLines)
However, the result is Error in file(con, "r") : cannot open the connection
. I tried to set the working directory, change the file name to be simple, but none of it works. I test with readLines function for a specific file name. It works. But not for all the folder. Anyone can help, thank you in advanced?