Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) : cannot open file '/Users/hp/Documents/ESS580/ClassProject1/EDSFA_2022/filled_acres.csv': Permission denied
I have tried to fix this on my own using the below post. I have double checked that the permissions on the folder allow for reading and writing, and I use Rstudio as administrator. To my understanding, there isnt antivirus software on this computer.
Either you must write a complete absolute path, which on windows is "c:/Users/hp/Documents/..."
or you must write the path relative to your working directory. So if you want to store the csv-file in your working directory, just write "filled_acres.csv".
Any chance that you have the file (filled_acres.csv) opened in eg. Excel, while you try writing from R? That will lock the file, and give exactly the error you write.
Hmm - I'm getting low on ideas. Have you tried writing to other files with other methods? What happens if you do: dput(x=1,file="test.Robj")
or dput(x=1,file="filled_acres.csv")