Without detailed information about a specific code, I would share my personal experience with the same error for your reference. In my case, I used RStudio to create a brilliant application that saves data in a local directory on my computer, and I told R to output files to the "directory" response, I did not create such a directory under the working directory, an error. Just by creating a subdirectory called "response", solve it right away. Or to move project files to different places in the future, you can simply check if the folder exists, if not, create one, this should save you a lot of time.
source share