JMarcelino
JMarcelino

Reputation: 984

R code execution error

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.

Upvotes: 2

Views: 10705

Answers (2)

FrankThe Cat
FrankThe Cat

Reputation: 21

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 :)

Upvotes: 2

January
January

Reputation: 17090

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.

Upvotes: 0

Related Questions