I have been unable to import data file from the Coursera learning course that I am currently into. Here are the course note and instructions.
Step 2: Import data
One of the most common file types data analysts import into R
is comma separated values files, or .csv files. The tidyverse
library package readr
has a number of functions for "reading in" or importing data, including .csv files and other external sources.
In the chunk below, use the read_csv()
function to import data from a .csv in the project folder called "hotel_bookings.csv" and save it as a data frame called bookings_df
.
If this line causes an error, copy in the line setwd("projects/Course 7/Week 3") before it.
The results will display as column specifications:
Here is the code chunk: bookings_df <- read_csv("hotel_bookings.csv")
However, despite several trials, I keep getting these errors
read_csv("hotel_bookings.csv")
Error: 'hotel_bookings.csv' does not exist in current working directory ('/cloud/project').
bookings_df <- read_csv("hotel_bookings.csv")
Error: 'hotel_bookings.csv' does not exist in current working directory ('/cloud/project').
read_csv()
Error in vroom::vroom(file, delim = ",", col_names = col_names, col_types = col_types, :
argument "file" is missing, with no default
bookings_df <- read_csv("hotel_bookings.csv")
Error: 'hotel_bookings.csv' does not exist in current working directory ('/cloud/project').
head(bookings_df)
Error in head(bookings_df) : object 'bookings_df' not found
setwd("projects/Course 7/Week 3")
Error in setwd("projects/Course 7/Week 3") :
cannot change working directory
read_csv("hotel_bookings.csv")
Error: 'hotel_bookings.csv' does not exist in current working directory ('/cloud/project').
Please I need your help to proceed, thank you.