0

So I am trying to save an altered dataset as a .csv file in R. I am using the write.csv function and everything looks accurate but it says that no such directory exists.

Here is the command:

write.csv(Example.raw.data,
    "C:/Users/bradenholmes/Documents/Finance363/NewRawData.csv")

And here is the error:

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/bradenholmes/Documents/Finance363/NewRawData.csv': No such file or directory

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • What are the results if you work your way down the file path with `list.files()`, e.g. `list.files("C:/Users/bradenholmes/Documents"); list.files("C:/Users/bradenholmes/Documents/Finance363")` ? Are you considering case-sensitivity? You should also be able to use `~` (tilde) as a shortcut for your home directory, i.e. `"~/Documents/Finance363/NewRawData.csv"` – Ben Bolker Jun 16 '22 at 23:28
  • @Mako212, really?? https://stackoverflow.com/questions/8425409/file-path-issues-in-r-using-windows-hex-digits-in-character-string-error – Ben Bolker Jun 17 '22 at 02:03

0 Answers0