我正在使用googlesheets4来存储闪亮的数据。我可以到达我的googleDrive,但我不能阅读任何工作表。我也尝试了"sheet_examples“,但我得到了相同的错误信息,如下所示。下面是给出错误的一段代码:
我试过了:
drive_auth(email="MyEmail@gmail.com")
sheets_auth(token = drive_token())
(DRIVE = drive_get("MySpeadSheet"))
SPE = read_sheet(DRIVE, range = "MySheet")我尝试了使用"read_sheet“(包括sheets_examples)获取工作表的不同方法,但每次都得到以下错误:
Error in parse(df$cell, ctype, ...) : is_string(ctype) is not TRUE发布于 2020-09-15 14:05:05
以下代码适用于我:
my_data = read_sheet(ss, sheet = "city-popul", range = "C2:C50", col_types="c")它指定该列为字符。
请在此处查看规格:https://googlesheets4.tidyverse.org/reference/read_sheet.html
对于多个列,您需要指定每个列的类型;请参阅规范中的示例。
https://stackoverflow.com/questions/58998384
复制相似问题