Issues with Using read.csv

I need help with loading data with read.csv on the R programming language i am taking on google.
This is the code
read.csv("hotel_bookings.csv")
The error message is
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'hotel_bookings.csv': No such file or directory
I included this other code before the read.csv code as instructed
setwd("projects/Course 7/Week 4")
The error message is
Error in setwd("projects/Course 7/Week 4") :
cannot change working directory
Please I need help with this. Thanks.

Is projects/Course 7/Week 4 a subdirectory of the current working directory? You can see what the current directory is with the command getwd().
You can always use the absolute path in setwd(). On Windows, that would be something like
setwd("C:/users/YourUserName/Documents/projects/Course 7/Week 4").

1 Like

@FJCC yes it is. okay, I will try the two options.
Thank you for your response

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.