Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.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 如何使用库(googlesheets)更改Google帐户?_R_R Googlesheets - Fatal编程技术网

R 如何使用库(googlesheets)更改Google帐户?

R 如何使用库(googlesheets)更改Google帐户?,r,r-googlesheets,R,R Googlesheets,我遇到了一些问题。我在一台机器上成功地使用了R脚本。在不同的计算机上使用相同的脚本会导致问题: # Here I register the sheet 浏览器包括您的凭据,并通过您的Google帐户确认浏览器身份验证: options(googlesheets.client_id = "", googlesheets.client_secret = "", googlesheets.httr_oauth_cache = FALSE) gs_auth(token = NUL

我遇到了一些问题。我在一台机器上成功地使用了R脚本。在不同的计算机上使用相同的脚本会导致问题:

# Here I register the sheet 

浏览器包括您的凭据,并通过您的Google帐户确认
浏览器身份验证

 options(googlesheets.client_id = "",
    googlesheets.client_secret = "",
    googlesheets.httr_oauth_cache = FALSE)

gs_auth(token = NULL, new_user = FALSE,
    key = getOption("googlesheets.client_id"),
    secret = getOption("googlesheets.client_secret"),
    cache = getOption("googlesheets.httr_oauth_cache"), verbose = TRUE)

干杯

gs_auth
返回一个“令牌”。每个令牌都可以保存到一个R数据文件中,然后传递给调用
gs\u auth
,以更改当前会话的内部保存令牌。您可能在使用了
googlesheets
之后缓存了凭据,并且缓存文件应该是主目录中的
.httr oauth
 options(googlesheets.client_id = "",
    googlesheets.client_secret = "",
    googlesheets.httr_oauth_cache = FALSE)

gs_auth(token = NULL, new_user = FALSE,
    key = getOption("googlesheets.client_id"),
    secret = getOption("googlesheets.client_secret"),
    cache = getOption("googlesheets.httr_oauth_cache"), verbose = TRUE)