【问题标题】:How to add the current date into a google worksheet name with R?如何使用 R 将当前日期添加到谷歌工作表名称中?
【发布时间】:2018-02-28 16:53:56
【问题描述】:

我正在使用 R,并尝试在工作表标题中创建一个包含今天日期的谷歌工作表。到目前为止,这是我的代码......我不知道我错过了什么或者这是否可行。任何建议或帮助将不胜感激。


    library(googlesheets)
    register_the_sheet <- gs_title("Sheet Name")
    register_the_sheet <- register_the_sheet %>%
    gs_ws_new(ws_title = today(), input = data, trim = TRUE, verbose = FALSE)

【问题讨论】:

    标签: r timestamp r-googlesheets


    【解决方案1】:

    我不知道您在 R 中从哪里得到“today()”,但使用更标准的“Sys.time”,您可能希望将今天的日期格式化为字符串:

      > todayStr<- format(Sys.time(), "%Y%m%d")
      > todayStr
    [1] "20180228"
    

    【讨论】:

      猜你喜欢
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-01
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      相关资源
      最近更新 更多