I am receiving the following error when trying to save a data frame file to .csv:
write.csv(deck, file = "cards.csv", row.names = FALSE)
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 'cards.csv': No such file or directory
Are you in a working directory with limited permissions? Can you try saving in a different directory? Can you try saving a very simple object, e.g.
write.csv(1, file = "cards.csv", row.names = FALSE)
I am the Admin with full permissions. I am having problems creating Projects also, and I think they are related. The issues seem to have started with the upgrade of RStudio.
Even as Admin, there could be weird restrictions, for example on Windows, the fact that Documents is hosted on OneDrive has caused problems to some people. Hence the idea of trying to create any file anywhere to help narrow down which part is causing the problem.
Can you try from R on the terminal (not RStudio)?
Just did, got the same errors:
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 'cards.csv': Permission denied
Maybe it is a Windows 11 build thing. I will try and post the errors in Microsoft feedback hub also.
You might try resetting RStudio's state (bit of a long-shot). Another thing to try would be to spell out the full path in the file argument.
What did you try that gave this error? Your message doesn't say.
Not yet, still exploring solutions.