Google cloud storage 将Google云存储中的大型文件读取到Rstudio

Google cloud storage 将Google云存储中的大型文件读取到Rstudio,google-cloud-storage,rstudio-server,Google Cloud Storage,Rstudio Server,我有一个谷歌云虚拟机实例连接到谷歌云存储桶。我正在运行Rstudio服务器,并试图从bucket中读取一些.csv数据集作为data.table(从data.table包)。 我正在使用googleCloudStorageR软件包,在解析从bucket接收到的二进制数据时遇到了困难。 步骤如下: raw.data <- gcs_get_object(MYFILEOBJECT) #This parses as class raw. MYFILEOBJECT is a .csv of size

我有一个谷歌云虚拟机实例连接到谷歌云存储桶。我正在运行Rstudio服务器,并试图从bucket中读取一些.csv数据集作为data.table(从data.table包)。 我正在使用googleCloudStorageR软件包,在解析从bucket接收到的二进制数据时遇到了困难。 步骤如下:

raw.data <- gcs_get_object(MYFILEOBJECT) #This parses as class raw. MYFILEOBJECT is a .csv of size 3GB on the bucket.
char.data <- rawToChar(raw.data,multiple=TRUE) #This should parse to character. I use multiple=TRUE because it's a long vector. The problem is that this is extremely slow.
DT <- fread(char.data) # ultimately I am trying to read the data in as data.table.

raw.data根据
##如果您想自己进行解析,请将parseObject设置为FALSE##使用httr::content()解析之后的raw#下载也许您可以将文件加载到BigQuery或类似文件中,因为它们是CSV。BigQuery直接接受来自云存储的加载。根据
###如果您想自己进行解析,请将parseObject设置为FALSE###使用httr::content()解析原始文件(下载后也许您可以将文件加载到BigQuery或类似文件中,因为它们是CSV。BigQuery直接从云存储接受加载。