Google Analytics Course: RStudio Cloud won't let me upload "hotel_bookings.csv"

I am taking the Google Data Analytics Course. I am in course 7 and its all about R. However in week 2 and 3, I have had trouble uploading the "hotel_booking.csv" using the following:
hotel_bookings <- read_csv("hotel_bookings.csv")

In the activity, they said if there is an error message to have this prior to the previous code:
setwd("projects/Course 7/Week 3")

However, I continue to get these error codes.

hotel_bookings <- read_csv("hotel_bookings.csv")
Error: 'hotel_bookings.csv' does not exist in current working directory ('/cloud/project').

setwd("projects/Course 7/Week 3")
Error in setwd("projects/Course 7/Week 3") :
cannot change working directory

Does anyone have any tips or a solution to this issue?

1 Like

I'm currently facing the same challenge. Please let me know how you solved yours

library(readr)
hotel_bookings <- read_csv("Course 7/Week 3/hotel_bookings.csv")
View(hotel_bookings)

4 Likes

Try this. It worked for me.

Can you please clarify, in your topic title you say you have problems uploading the csv file to RStudio Cloud but you are showing code to read the file into memory and showing an error message saying that the file doesn't exist.

Uploading the file to RStudio Cloud is not the same thing as reading it into memory once the file is already uploaded, and you are not showing any error message concerning the upload process (using the upload button).

FyneMichael has solved this for us. Thank you so much!

To clarify, the csv file was already in the Google Analytics project folder, but it would not let me access it with the code per the instructions.

Thanks for solving this problem FyneMichael!

Appreciate the responses.

1 Like

I'm really glad I could help. :innocent:

1 Like

This topic was automatically closed 7 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.