R 如何使用库(googlesheets)更改Google帐户?
我遇到了一些问题。我在一台机器上成功地使用了R脚本。在不同的计算机上使用相同的脚本会导致问题: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
# 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)