0

When I attempt to read the contents of google spreadsheet using the command:

data <-read.csv("https://docs.google.com//spreadsheets//drive.google.com//drive//folders//1h6u8CoszxaMYkqCuOEkVSayfHVeOLg1u",fileEncoding="UTF-8").

R reports an error:

Error in file(file, "rt", encoding = fileEncoding) : 
  cannot open the connection to 'https://docs.google.com//spreadsheets//drive.google.com//drive//folders//1h6u8CoszxaMYkqCuOEkVSayfHVeOLg1u'
In addition: Warning message:
In file(file, "rt", encoding = fileEncoding) :
  cannot open URL 'https://docs.google.com//spreadsheets//drive.google.com//drive//folders//1h6u8CoszxaMYkqCuOEkVSayfHVeOLg1u': HTTP status was '404 Not Found'

How can I resolve this issue?

Matt Summersgill
  • 4,054
  • 18
  • 47
Ramesh
  • 1
  • 1
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Jun 24 '23 at 07:19
  • Does this answer your question? [Importing data into R from google spreadsheet](https://stackoverflow.com/questions/22873602/importing-data-into-r-from-google-spreadsheet) – Matt Summersgill Jun 28 '23 at 18:40

1 Answers1

1

I think you need a specific package for this to work:

#Install the required package
install.packages('googlesheets4')
#Load the required library 
library(googlesheets4)

Maybe additional help can be found here -> https://www.digitalocean.com/community/tutorials/google-sheets-in-r

starship
  • 53
  • 1
  • 6