我目前正在运行
library(googlesheets4)
sheets_auth()
dat=read_sheet("https://docs.google.com/spreadsheets/d/1R9XuH9Wej-p6HdkFGV2IsHuCmA9w0s7M3-jzE3S-Qrs/edit#gid=950673024", sheet="Summary", range=cell_rows(1:777))并获得以下输出。
Suitable tokens found in the cache, associated with these emails:
* dcallow@umd.edu
* ddcc2442@gmail.com
The first will be used.
Using an auto-discovered, cached token.
To suppress this message, modify your code or options to clearly consent to the use of a cached token.
See gargle's "Non-interactive auth" vignette for more details:
https://gargle.r-lib.org/articles/non-interactive-auth.html
The googlesheets4 package is using a cached token for dcallow@umd.edu.
>
> dat=read_sheet("https://docs.google.com/spreadsheets/d/1R9XuH9Wej-p6HdkFGV2IsHuCmA9w0s7M3-jzE3S-Qrs/edit#gid=950673024", sheet="Summary", range=cell_rows(1:777))
Error: Client error: (403) PERMISSION_DENIED
* Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client doesn't have permission, or the API has not been enabled for the client project.
* The caller does not have permission我不确定问题是不是它迫使我使用第一封电子邮件?可以换成第二个令牌吗?但我也很困惑,为什么我不再被要求进入我的谷歌账户进行身份验证?
你知道为什么会发生这种情况吗?我是API的新手。
发布于 2020-12-29 07:03:32
你可以试试这个
库(Googlesheets4)
gs4_auth_configure(api_key =“A.bMGBUA”)
您应该在credentials https://console.cloud.google.com/apis/credentials中创建一个api key
我等着它能帮到你
发布于 2021-08-17 11:51:56
这可能是因为您在使用gs_auth登录时,一定是选择了错误的权限。要重新分配您的权限,首先使用gs_deauth()进行deauth,然后使用gs_auth(),然后在下一个选项中,在Selection:中输入0以重新初始化您对谷歌帐户的访问。确保在浏览器窗口中分配权限时,选中了读取、写入电子表格的复选框。
如果你不能做到这一点,请评论。
继续编码!
发布于 2021-10-21 19:38:59
你也可以在谷歌页面上的“分享”按钮下,将GoogleSheet链接设置为“互联网上任何拥有该链接的人都可以查看”。然后:
googlesheets4::gs4_deauth()
CellROSConc <- read_sheet("https://docs.google.com/spreadsheets/d/1bxTIKTNfv-n3Y-JMJCOlt14Ec3e4tSdBQZg-HiuypOY/edit?usp=sharing")https://stackoverflow.com/questions/61356212
复制相似问题