Having issues importing data from from outside source

bookings_df <- read.csv("hotel_bookings.csv")

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

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

I have seen that beore and cannot remember why I got it but you might want to use the complete path starting from your root directory.

Something in Linux

bookings_df <- read.csv("~/projects/Course 7/Week 3/hotel_bookings.csv")

It has been a long time since I used Windows but perhaps

bookings_df <- read.csv("C:/projects/Course 7/Week 3/hotel_bookings.csv")

Otherwise shut down R/Rstudio and start afresh.

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.