.csv file not found while I am standing in the right place

Please help me to find the error source. I wanna open a .csv file in Rstudio. I am in the right directory but not opened. The error is below:

food <- read.csv("bbb.csv")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : cannot open file 'bbb.csv': No such file or directory


In the screenshot you wrote

re <- read.csv("bbb")

instead of

re <- read.csv("bbb.csv")

Maybe the problem is just that?

I wanted to share another photo, but it gave an error. Please check the second photo script.



Can you show where the file is? By the RStudio file viewer, or even your computer's normal file browser.

And then in R use getwd() to see what path R is operating in

Yeah... sure.



That's promising.
And in R again try the function dir() to see the files listen in the working directory.

Of course.


It is there, but not opened.

Is this a problem with all .csv on your system or just with the .csv of this particular folder?

Try to call the file with the whole path "C:/Users/mehrdad/Documents/bb/bbb.csv"
May be there is a problem with the permission of the bbb.csv?


I have just this .csv file. I have the file with .xlsx extension. I have the same problem.
I have no idea!

On your computer every / should be written as two // for R

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.