【发布时间】:2019-05-13 13:39:39
【问题描述】:
我需要从闪亮的日期范围输入中提取年份和月份。我试过了:
output$sampled <- renderText({
x <- as.character(format(input$daterange[1], "%Y"))
})
但我收到了NULL。我需要像2018-08
【问题讨论】:
标签: r shiny rstudio date-range shiny-reactivity
我需要从闪亮的日期范围输入中提取年份和月份。我试过了:
output$sampled <- renderText({
x <- as.character(format(input$daterange[1], "%Y"))
})
但我收到了NULL。我需要像2018-08
【问题讨论】:
标签: r shiny rstudio date-range shiny-reactivity
您将需要"%Y-%m" 而不是"%Y"。
请参阅?strptime 以了解已实施的转换规范(特定于平台)的概述。
但我怀疑当您收到 NULL 时,您的代码中还有其他问题,通常它应该只返回年份(我需要一个代表示例来深入挖掘)。
顺便说一句。你在这里看到我的answer 了吗? - 如果还是同样的问题?
【讨论】: