我如何将Google云端硬盘中的Google电子表格读入R?

问题描述 投票:0回答:1

我正在尝试将电子表格从我的Google云端硬盘读取到R中,而不在本地下载。根据论坛上其他问题的建议,我一直在使用googledrivegooglesheets4软件包。我运行了以下代码:

> 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 

我在使用read_sheet()sheets_read()功能时均出错。我不确定从这里去哪里。有什么想法吗?

r google-sheets google-drive-api
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.