Unable to open an excel data file in RStudio 1.1.463

Dear RStudio Community

When I try to open an excel file with the command:
read.csv("C:/users/aidy/Downloads/2008.cvs")
I get the reply:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'C:/users/aidy/Downloads/2008.cvs': No such file or directory

There's no doubt the file exists, I can open it in excel...
I've tried various things, for example in RStudio going to File, Import; and also in the code changing the direction of the slash, and lower case letters for upper case... no success...

Maybe something that's associated with this problem is that I couldn't open the RStudio software I'd initially downloaded, I had to resort to an older version (1.1.463), and maybe this is because my laptop is 8 years old, Windows 72, 32-bit... also, I've only just today updated my Google browser...

Please help!..

I need to open this excel file in RStudio for an online course I'm doing with Future Learn called [INTRODUCTION TO R FOR DATA SCIENCE-PURDUE UNIVERSITY]... they've had this sort of problem before, but none of the tutors is available to help at the moment...

Thanks for reading this!

Thank you!
I just typed in:
read.csv("C://Users/Aidy/Downloads/2008.csv")
I got:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'C://Users/Aidy/Downloads/2008.csv': Permission denied

This is not a valid windows path, double check the path you are using, most likely you are just typing ti wrong.

Funny because with:
read.csv("C:\Users\Aidy\Desktop\R files\2008.csv")
I get:
Error: '\U' used without hex digits in character string starting ""C:\U"
As if it doesn't like backslashes but does like forward slashes...
I've looked at a few typo mistake possibilities, nothing resolved yet...

In Windows you can either use double-backslashes (instead of single) or forward slashes (like on Linux):

read.csv("C:\\Users\\Aidy\\Desktop\\R files\\2008.csv")
read.csv("C:/Users/Aidy/Desktop/R files/2008.csv")

Single backslashes are used for other purposes in R.

Wow!
Something has happened! Some data has been transferred to the 'console' (not the 'environment' as happens on the course I'm studying.)
Thank you very much! I'll work with this data soon, and I'll see what happens...
Awesome, thanks again!

You need to assign the read.csv() statement to a variable. The course should cover that.

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