2

When I try to import a data set from text file, an error appears:

Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file 'C:/Users/Joana/Documents/Estatística_R/Densidade População/Density/Dados_Cascavel_quadrantes.csv': No such file or directory

This happens with all of the csv/txt files I have. Somebody know what can I do?

My Rstudio version is 0.97.551.

Thomas
  • 43,637
  • 12
  • 109
  • 140
JMarcelino
  • 904
  • 4
  • 13
  • 30
  • Can you copy the command that produced this error to the question? – Thomas Jul 09 '13 at 12:33
  • You're not pointing to the file correctly. `file.choose()` will give you the correct path. I personally don't use spaces or localized characters for file or folder names. – Roman Luštrik Jul 09 '13 at 12:36
  • That's a lot of unusual symbols in the directory names. Have you tried creating a file directly in Documents? – David Robinson Jul 09 '13 at 12:36
  • The problem solved itself, I've know idea how or why. This happened with every files, no matter the directory or the filename. – JMarcelino Oct 23 '13 at 17:28

2 Answers2

2

I had the same issue, but it only happened with that one csv. I looked into what was different and found, that the solution was simply special characters in the name of the file. When I removed the "ä" I had in the name, it worked perfectly fine. Might be a bit too late... but to everyone who sees this in the future :)

0

I think the problem is in the non-ASCII characters in the file and directory names. Move the CSV to the directory C:/Users/Joana/Documents/ and rename it to test.csv. Then try to open it again: I bet it will work.

I have no idea how to solve that -- it works fine on my Unix system, whereas you are on Windows. See also this stackexchange question.

Community
  • 1
  • 1
January
  • 16,320
  • 6
  • 52
  • 74