Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用R在google电子表格中插入行_R_Google Sheets - Fatal编程技术网

使用R在google电子表格中插入行

使用R在google电子表格中插入行,r,google-sheets,R,Google Sheets,我需要通过R在google电子表格文档中添加新行。我知道如何使用Curl在R中读取电子表格,但我不知道是否可以将新行从R插入google电子表格 这是在谷歌电子表格中读取行的代码 google_ss <- function(gid = NA, key = NA) { if (is.na(gid)) {stop("\nWorksheetnumber (gid) is missing\n")} if (is.na(key)) {stop("\nDocumentkey (key) is

我需要通过R在google电子表格文档中添加新行。我知道如何使用Curl在R中读取电子表格,但我不知道是否可以将新行从R插入google电子表格

这是在谷歌电子表格中读取行的代码

google_ss <- function(gid = NA, key = NA) 
{
  if (is.na(gid)) {stop("\nWorksheetnumber (gid) is missing\n")}
  if (is.na(key)) {stop("\nDocumentkey (key) is missing\n")}
  require(RCurl)
  url <- getURL(paste("https://docs.google.com/spreadsheet/pub?key=", key,
                      "&single=true&gid=", gid, "&output=csv", sep = ""),
                cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl"))
  read.csv(textConnection(url), header = T, sep = ",")
}

google\u ss您可以使用软件包中的
gs\u add\u row()
gs\u edit\u cells()
函数。有关示例,请参见谷歌表单。

请向我们展示您已经编写的代码。谢谢,有用吗?是的@Ben Bolker我想这就是我的答案searching@calejero如果您已经找到了答案,请与社区共享!(见附件)