Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R googlesheets4将令牌作为参数传递到读取工作表_R_Google Sheets_Token_Googlesheets4 - Fatal编程技术网

R googlesheets4将令牌作为参数传递到读取工作表

R googlesheets4将令牌作为参数传递到读取工作表,r,google-sheets,token,googlesheets4,R,Google Sheets,Token,Googlesheets4,只有在工作表已经授权的情况下,我才能阅读工作表 如果不是,则会忽略后续的每一行代码,因为代码执行会不断请求令牌。有没有办法将令牌索引传递到read_sheet命令中,或者事先授权访问 > aa <- read_sheet('https://docs.google.com/spreadsheets/d....', sheet='Akinesia', range="AC:AH") The googlesheets4 package is requesting a

只有在工作表已经授权的情况下,我才能阅读工作表

如果不是,则会忽略后续的每一行代码,因为代码执行会不断请求令牌。有没有办法将令牌索引传递到read_sheet命令中,或者事先授权访问

   > aa <- read_sheet('https://docs.google.com/spreadsheets/d....', sheet='Akinesia', range="AC:AH")
The googlesheets4 package is requesting access to your Google account. Select a pre-authorised account or enter '0' to obtain a new token. Press Esc/Ctrl + C to abort.

1: chris.elliott@.....

Selection: 
Enter an item from the menu, or 0 to exit
Selection: 
Enter an item from the menu, or 0 to exit
Selection: 
Enter an item from the menu, or 0 to exit
Selection: aaX <- aa  %>% filter_all(any_vars(!is.na(.)))
Enter an item from the menu, or 0 to exit
Selection: akns <- aaX %>% pivot_longer(-genotype, names_to = "day", values_to = "nonresp")
Enter an item from the menu, or 0 to exit

>aa您需要进行身份验证调用,该调用提供不同的身份验证方法:

默认身份验证 尝试不带参数的默认呼叫,或使用与Google帐户关联的电子邮件地址:

googlesheets4::gs4_auth(email=“chris。elliott@...")
服务帐户 您还可以传递与服务帐户关联的令牌文件:

googlesheets4::gs4_auth(path=“access\u token.json”)
path—标识服务帐户的JSON,格式为jsonlite::fromJSON()的txt参数所支持的格式之一(通常为文件路径或JSON字符串)

漱口代币
googlesheets4
使用软件包,因此您还应该能够获得如下令牌:

库(漱口)

对不起,这些没用。默认身份验证和服务帐户都返回了消息
,googlesheets4软件包请求访问您的Google帐户。选择预先授权的帐户或输入“0”以获取新令牌。按Esc/Ctrl+C中止。
这无助于自动获取保存的令牌,漱口令牌代码刚刚启动Google密码对话框。我真的很想能够自动选择男子项目No.1try的第一个选项与电子邮件参数设置明确