当我在R中使用googlesheets4时,我在控制台中使用了sheets_auth(),它工作得很好。但是当我尝试在R markdown中运行它时,当我尝试编织时,我似乎无法获得凭据。有人能给我讲讲这个过程吗?我去了googlesheets4的小插曲,但似乎不能理解它。
发布于 2021-11-21 02:43:20
这对我很有效
gs4_auth(path = "xxxxxxxxxxxxxxxx.json")它不会返回任何内容,但之后我就可以使用sheet_write()在我的工作表中写入数据了
要获取json文件中的凭据,您必须执行以下步骤:
googledrive从开发人员控制台,在目标GCP项目中,转到IAM &管理>服务帐户。googledrive给它一个像样的名称和description.
(从这里复制https://gargle.r-lib.org/articles/get-api-credentials.html#service-account-token)
https://stackoverflow.com/questions/62768419
复制相似问题