How to read csv file from googledrive?

Hi all,
how can I read the CSV file stored in google drive?
This is my link for the data.

Thank you.!

The following worked for me, though I would not be surprised to find out there is a better way.
I right clicked on the file in my google drive and selected Get Link. In that dialog, I set the permission to let anyone with the link download the file. I then copied the displayed link which had the form

https://drive.google.com/file/d/LongStringOfRandomCharacters/view?usp=sharing

I then used the document ID, that long string of characters in the following code.

id <- "LongStringOfRandomCharacters"
DF <- read.csv(sprintf("https://docs.google.com/uc?id=%s&export=download", id))

I tried pulling out the ID from your link and the above did not work and I'm not sure why. I got the method that worked for me from here:

I did the same as you suggested.

Moreover,

this is not working in my system.
I'm not sure whether I have to make any changes..!!

Have you tried the googlesheets4 package? You will be asked to authenticate. Afterwards, you can read the CSV using read_sheet().

install.packages("googlesheets4")
# once installed
library(googlesheets4) 

# running read_sheet() will ask you to authenticate with Google first
read_sheet("https://docs.google.com/spreadsheets/d/13ZvAgt9oYVpPN_FJMoQKLHsH23HyDmyPo-jfPl2_6HY/edit#gid=896420200")

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