Why R cannot read a csv file in a working directory?

I tried to load a CSV file but failed.
so this time, I created a file with R in the working directory and tried to read it but also failed.
Please let me know the reason.
Thank you so much in advance.

AAA
x y z
1 1 a T
2 2 b F
3 3 c T
write.csv(AAA,file = "AAA.csv",row.names = FALSE)
read.csv("AAA",header = TRUE)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : cannot open file 'AAA': No such file or directory

Are you sure you have got the file names right? You seem to be missing the extension in your read.csv() call...

You may want to consider read.csv("AAA.csv") instead.

3 Likes

Thank you so much. :grinning:
Sometimes stupid trivial errors annoy me and make me waste a long time.

1 Like

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