0

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

zx8754
  • 52,746
  • 12
  • 114
  • 209
dkro
  • 193
  • 1
  • 8
  • Is your issue related to this one on Github (related to character encoding)? github.com/tidyverse/googlesheets4/issues/59? – ravic_ Nov 22 '19 at 17:54
  • If you can create a similar sample sheet that's sharable with a link, that would help us troubleshoot. And if it includes degree characters, accented characters, etc., would help to include some of those. – ravic_ Nov 22 '19 at 17:56
  • There's more guidance here, including looking at the `gargle` version, and potentially using the dev version: https://github.com/tidyverse/googlesheets4/issues/26 – ravic_ Nov 22 '19 at 18:03
  • @ravic_ I have included a link to the spreadsheet in the Edit. I also tried installing `gargle` and faced the same issues. – dkro Nov 22 '19 at 19:37
  • I was able to make a copy of your sheet and read it. I'm on a Mac, and if you're on Windows, that does potentially trigger the bug. Perhaps others can help find the issue. – ravic_ Nov 22 '19 at 20:26
  • @ravic_ Yep, I am on Windows – dkro Nov 22 '19 at 20:48

0 Answers0