【问题标题】:R: googlesheets/gs_upload: Upload to a specific folderR:googlesheets/gs_upload:上传到特定文件夹
【发布时间】:2016-02-11 10:34:39
【问题描述】:

使用 googlesheets 包,我正在尝试将 csv 上传到 GDrive 中的特定文件夹。

例子:

## Not run: 
write.csv(head(iris, 5), "iris.csv", row.names = FALSE)
gs_upload("iris.csv")

上面会将文件上传到我的主目录,但我需要将文件放在特定目录中,因为我想创建多个文件并能够共享整个目录。

或者,如果有一种方法可以在创建后以编程方式移动文件,那也可以。

【问题讨论】:

    标签: r google-sheets r-googlesheets


    【解决方案1】:

    您可以使用googledrive 包在文件创建后移动它:

    library(googledrive)
    drive_mkdir("iris_folder")  # make folder in home Drive directory
    drive_mv(file = "iris", path = "iris_folder/")  # move Sheets file
    

    【讨论】:

      【解决方案2】:

      希望这会有所帮助。它可能不是你想要的,但它肯定会达到最终目的。

      http://www.labnol.org/internet/receive-files-in-google-drive/19697/

      该链接显示了如何使用谷歌表单来获取文件。表单的响应存储在您的 Google Drive 中的电子表格中。根据响应表的位置,您也可以将文件存储在该文件夹中。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-10-23
        • 1970-01-01
        • 1970-01-01
        • 2021-04-27
        相关资源
        最近更新 更多