Mam ten kodDlaczego otrzymuję ten danych Błąd zapisu do pliku
myvector <- c(3.45235, 1.32525, ... , 2.41351) # some numbers
write(myvector, "C:/mypath/myfile.txt") # I use "/" instead of "\"
i pojawia się następujący błąd:
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:/mypath/myfile.txt' : No such file or directory
czytałem this tutorial, ale nie mogę understant co się stało z moim kodem. Dowolny pomysł?
edit:
Jak @dickoa wskazał, muszę istniejącą ścieżkę zapisu pliku, więc starałem się uprościć w następujący sposób:
file.exists("C:/")
write(myvector, "C:/myfile.txt")
Zaskakująco: P ścieżka "C: /" istnieje (wynik jest PRAWDZIWY), ale pojawia się podobny błąd:
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:/mypath/myfile.txt' : Permission denied
Jaki jest wynik 'file.exists (" C:/mypath ")'? – dickoa
@dickoa Otrzymuję błąd w eval (expr, envir, enclos): nie mogę znaleźć funkcji "file.exist" – 888
Mój zły jest "s" na końcu. Zmieniłem mój komentarz: – dickoa