【发布时间】:2021-02-04 12:53:06
【问题描述】:
我设法生成了密钥和令牌,以便能够从 r 控制台中访问谷歌云存储文件。
但是,在执行下面的代码时,我遇到了以下错误 -
Error: $installed not found in JSON - have you downloaded the correct JSON file?
(Service account client > Desktop, not Service Account Keys)
虽然代码已从以前的 SO 帖子中解决/提供,但该错误对我来说仍然很神秘。
-- 所以在下面发帖
Accessing files from Google cloud storage in RStudio
-- 完整代码如下
rm(list = ls(all.names = TRUE))
options(java.parameters = "-Xmx8000m")
library(googleCloudStorageR)
library(googleAuthR)
library(jsonlite)
# for working in google cloud storage
GCS_AUTH_FILE = "serviceaccount.json"
GAR_CLIENT_WEB_JSON = "Oauthclient.json"
# fromJSON(GCS_AUTH_FILE)
# fromJSON(GAR_CLIENT_WEB_JSON)
gar_auth_service(GCS_AUTH_FILE)
#set the scope
gar_set_client(scopes = c("https://www.googleapis.com/auth/devstorage.read_write",
"https://www.googleapis.com/auth/cloud-platform"), json = GAR_CLIENT_WEB_JSON
)
【问题讨论】: