https://researchdatapod.com/how-to-solve-r-error-in-filefile-ifelseappend-a-w-cannot-open-the-connection/
How to Solve R Error in file(file, ifelse(append, 'a', 'w')) : cannot open the connection