使用R编辑现有的Google文档电子表格

时间:2015-03-26 19:17:21

标签: r google-docs google-docs-api

我听说过并且一直在测试RGoogleDocs R软件包,它可以让您登录帐户并查看Google文档以及上传或删除它们。我可以采取创建新文档的路线,然后在销毁旧文档后上传它,但我想要一种更优雅的方式。

我使用rgoogledocs访问我的电子表格。当编辑时我无法改变任何值。

#this line returns the value in the worksheet in column 1 row 1
myworksheet[[1]][1,1]

#this command does nothing, but I would like to change the value to cow
myworksheet[[1]][1,1] = "cow"

1 个答案:

答案 0 :(得分:4)

您可以尝试新的googlesheets包。将单元格A1设置为“cow”的示例交互:

library(devtools)
install_github('jennybc/googlesheets')
library(googlesheets)

my_sheets <- list_sheets()
myworksheet <- register_ss("worksheetname")
edit_cells(myworksheet, ws = 1, input = "cow", anchor = "A1")
相关问题