Mehy
April 20, 2020, 9:11pm
1
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
Raf
April 20, 2020, 9:17pm
2
In the screenshot you wrote
re <- read.csv("bbb")
instead of
re <- read.csv("bbb.csv")
Maybe the problem is just that?
Mehy
April 20, 2020, 9:32pm
3
I wanted to share another photo, but it gave an error. Please check the second photo script.
thanks
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
That's promising.
And in R again try the function dir() to see the files listen in the working directory.
Mehy
April 20, 2020, 10:24pm
8
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?
Mehy
April 21, 2020, 8:33am
10
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
system
Closed
May 12, 2020, 9:23am
12
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.