我在Google Cloud Datalab中使用R,我想将我的输出(这是一个包含在代码本身中创建的字符串的表)保存到BigQuery。我知道有一种方法可以通过使用bqr_create_table
来使用Python,所以我在寻找R中的等价物。
我在Google Cloud Platform上找到了来自Gus Class的blog post,它使用此代码写入BigQuery:
# Install BigRQuery if you haven't already...
# install.packages("devtools")
# devtools::install_github("rstats-db/bigrquery")
# library(bigrquery)
insert_upload_job("your-project-id", "test_dataset", "stash", stash)
其中"test_dataset"
是BigQuery中的数据集,"stash"
是数据集中的表,stash
是您使用数据定义的任何数据帧。
有关如何使用bigrquery进行授权的更多信息