I am trying to export some data from R to .csv. It was working yesterday but today I got this error message:
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 'C:/Users/cgarf/Documents/OTL_Model': Permission denied
I recently changed java versions. I'm not sure if that could be causing the issue or if I'm missing something
That error is often because you are trying to write a file to a directory.
BTW, in case it helps you narrow down where the directory is being used (instead of a filename), I just
grep
ed R source (base libraries) and found exactly two instances ofifelse(append, "a", "w")
:line 28 of
base/R/cat.R
; andlines 108-109 of
utils/R/write.table.R
(which is also containswrite.csv
and friends).(Those links are provided "now" as of commit 5b2f6e4.)