I am unable to insert/import csv/excel file in R studio. Please tell me how to import that file in detail.I have already tried many codes but it couldn’t work. i have installed all the necessary packages which are mentioned in the video.
Start your code here s <- read.csv("C:/Users/hp/Documents/Data Science/365 Data Science/Data Visualisation/bar_chart_data")
and it’s showing error :
Error in file(file, “rt”) : cannot open the connection
In addition: Warning message:
In file(file, “rt”) :
cannot open file ‘C:/Users/hp/Documents/Data Science/365 Data Science/Data Visualisation/bar_chart_data’: No such file or directory
Please help with this problem. The file directory is correct *.
thanks for reaching out! To read the file in R and Python, you need to include the file extension when specifying the path. For a csv file, you should add .csv, for an excel file .xslx and so on.
So, in your code it should be:
s <- read.csv("C:/Users/hp/Documents/Data Science/365 Data Science/Data Visualisation/bar_chart_data.csv")