Priyanka G
Priyanka G

Reputation: 51

How to overwrite a CSV file in R?

I want to output a CSV file to a specified location. The code should overwrite the existing CSV file at the specified location each time the code runs.

I am getting an error saying :
Error in file(file, ifelse(append, "a", "w")) : cannot open the connection

Thanks in advance!

Upvotes: 4

Views: 13971

Answers (1)

Ed Velho
Ed Velho

Reputation: 41

Probably your csv file is open. Close it and try again

Upvotes: 3

Related Questions