Last answered:

08 Sept 2020

Posted on:

28 Aug 2020

0

R studio

HELLO,
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 *.

1 answers ( 0 marked as helpful)
Instructor
Posted on:

08 Sept 2020

0
Hi omkar,  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")

Best,
365 Eli

Submit an answer