简体   繁体   English

Googlesheets4 不读取我的电子表格

[英]Googlesheets4 does not read my Spreadsheets

I am using googlesheets4 to store Shiny data.我正在使用 googlesheets4 存储 Shiny 数据。 I could reach my googleDrive but I am not able to read any sheet.我可以访问我的 googleDrive,但我无法阅读任何表格。 I also tried "sheet_examples" but I got the same error message, see below.我也试过“sheet_examples”,但我得到了同样的错误信息,见下文。 Here is a piece of code that gives the error:这是一段给出错误的代码:

I tried:我试过了:

drive_auth(email="MyEmail@gmail.com")
sheets_auth(token = drive_token())
(DRIVE = drive_get("MySpeadSheet"))
SPE = read_sheet(DRIVE,  range = "MySheet")

I have tried different ways to get my sheet with "read_sheet" (including sheets_examples) but every time I get the following error:我尝试了不同的方法来获取带有“read_sheet”(包括 sheet_examples)的工作表,但每次我收到以下错误:

Error in parse(df$cell, ctype, ...) : is_string(ctype) is not TRUE

The following code worked for me:以下代码对我有用:

my_data = read_sheet(ss, sheet = "city-popul", range = "C2:C50", col_types="c")

It specifies the column is character.它指定列是字符。

See the specs here: https://googlesheets4.tidyverse.org/reference/read_sheet.html请参阅此处的规格: https://googlesheets4.tidyverse.org/reference/read_sheet.html

For several column you will need to specify each column type;对于多个列,您需要指定每个列类型; see the examples in the specs.请参阅规范中的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM