I am trying to read a spreadsheet from my Google Drive into R without downloading it locally. Based on advice from other questions on this forum, I have been using the googledrive
and googlesheets4
packages. I ran the following code:
> drive_find(type = "spreadsheet",n_max = 1)
# A tibble: 1 x 3
name id drive_resource
* <chr> <chr> <list>
1 school_data 1TaO0U5teh-mnriPLzHmlAjrkEMEPivpzdcaqEPh5ohc <list [34]>
> (DRIVE = drive_get(id="1TaO0U5teh-mnriPLzHmlAjrkEMEPivpzdcaqEPh5ohc"))
# A tibble: 1 x 3
name id drive_resource
* <chr> <chr> <list>
1 school_data 1TaO0U5teh-mnriPLzHmlAjrkEMEPivpzdcaqEPh5ohc <list [34]>
> sheets_get(DRIVE)
Spreadsheet name: school_data
ID: 1TaO0U5teh-mnriPLzHmlAjrkEMEPivpzdcaqEPh5ohc
Locale: en_US
Time zone: America/Los_Angeles
# of sheets: 1
(Sheet name): (Nominal extent in rows x columns)
school_data: 667 x 35
> read_sheet(DRIVE)
Reading from 'school_data'
Error in parse(df$cell, ctype, ...) : is_string(ctype) is not TRUE
> sheets_read(DRIVE)
Reading from 'school_data'
Error in parse(df$cell, ctype, ...) : is_string(ctype) is not TRUE
I get errors with both the read_sheet()
and sheets_read()
functions. I am not sure where to go from here. Any ideas?
Edit:
Following advice in the comments, I ran the following code:
> devtools::install_github("r-lib/gargle")
Downloading GitHub repo r-lib/gargle@master
These packages have more recent versions available.
Which would you like to update?
1: curl (3.2 -> 4.2 ) [CRAN] 2: glue (1.3.0 -> 1.3.1) [CRAN] 3: jsonlite (1.5 -> 1.6 ) [CRAN] 4: mime (0.6 -> 0.7 ) [CRAN]
5: openssl (1.0.2 -> 1.4.1) [CRAN] 6: R6 (2.2.2 -> 2.4.1) [CRAN] 7: Rcpp (1.0.0 -> 1.0.3) [CRAN] 8: sys (3.2 -> 3.3 ) [CRAN]
9: CRAN packages only 10: All 11: None
Enter one or more numbers separated by spaces, or an empty line to cancel
1: 10
curl (3.2 -> 4.2 ) [CRAN]
glue (1.3.0 -> 1.3.1) [CRAN]
jsonlite (1.5 -> 1.6 ) [CRAN]
mime (0.6 -> 0.7 ) [CRAN]
openssl (1.0.2 -> 1.4.1) [CRAN]
R6 (2.2.2 -> 2.4.1) [CRAN]
Rcpp (1.0.0 -> 1.0.3) [CRAN]
sys (3.2 -> 3.3 ) [CRAN]
Installing 8 packages: curl, glue, jsonlite, mime, openssl, R6, Rcpp, sys
Installing packages into ‘C:/Users/krosi/OneDrive/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Error: (converted from warning) package ‘curl’ is in use and will not be installed
And ran into the same issues.
I am also providing a link to the dataset for replicability. https://docs.google.com/spreadsheets/d/1TaO0U5teh-mnriPLzHmlAjrkEMEPivpzdcaqEPh5ohc/edit?usp=sharing