2

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

# Here I register the sheet 

browser <- gs_title("Funnel Daily")

browser<-gs_edit_cells(ws="Classic Browser", browser, input = ClassicBrowser, anchor = "A1",byrow = FALSE, col_names = NULL, trim = F,verbose = TRUE)

Auto-refreshing stale OAuth token.
Error in gs_lookup(., "sheet_title", verbose) : 
 "Funnel Daily" doesn't match sheet_title of any sheet returned by gs_ls() (which        should reflect user's Google Sheets home screen).
   > browser <- gs_title("Funnel Daily")
Error in gs_lookup(., "sheet_title", verbose) : 
  "Funnel Daily" doesn't match sheet_title of any sheet returned by gs_ls() (which   should reflect user's Google Sheets home screen).`

如果使用gl_ls()我会收到有关我也经常使用的谷歌帐户的消息。那么有没有一种方法可以通过令牌左右来区分帐户或者我该如何解决这个问题issue。我的意思是如何强制googlesheets访问某些特定帐户?目前我正在使用token对应于Funnel Daily. 我能想到的唯一可能导致问题的可能性是浏览器身份验证是使用不包括在内的帐户完成的Funnel Daily..我只是把他们弄糊涂了。我试图删除googlesheets以及httr所有依赖项。但是在运行library(googlesheets)并询问gs_usergooglesheets 时,总是指不包含特定工作表的帐户。

4

1 回答 1

1

包括您的凭据并browser authentication通过您的 Funnel Daily 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)

干杯

于 2015-09-30T11:11:38.097 回答