I created a function extracting tables from docx files and combined them as one data set successfully with a sample folder of 4 docx files.
Then I linked the function to a folder with 500 files, and all of sudden, error came.
> lapply(files, FUN=docTodata)
Error: Cannot find 'marginversion1.docx'
This is the code, and I omit here the middle of the path that has my name.
# read all files in a directory
files<-list.files(path="C:/Users/...../files")
print(files)
When printing files, it successfully prints all the file names in the folder!!!!! but lapply() does not read files.