如何为 R Shiny 应用程序制作“日历”?

And*_*rii 2 label calendar r shiny

有很多用于在 Web 应用程序中制作日历的 JS 库。

如何为 R Shiny 应用程序制作带有标签日期的优雅日历解决方案,例如在 Google 日历中?

谢谢!

Por*_*hop 7

看看github上的 fullcalendar包,或者你可以在你的网站上添加一个谷歌日历

library(shiny)
library(fullcalendar)

data = data.frame(title = paste("Event", 1:3),
                  start = c("2017-03-01", "2017-03-01", "2017-03-15"),
                  end = c("2017-03-02", "2017-03-04", "2017-03-18"),
                  color = c("red", "blue", "green"))

ui <- fluidPage(
  column(6,
         fullcalendarOutput("calendar", width = "100%", height = "200px")
  )
)

server <- function(input, output) {
  output$calendar <- renderFullcalendar({
    fullcalendar(data)
  })
}

shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明