簡體   English   中英

R-閃亮應用

[英]R-Shiny Application

我正在嘗試構建一個 shiny 應用程序,其中用戶可以通過 shiny 應用程序輸入日期,然后觸發 R 腳本來利用該日期。
我想知道如何將 shiny 的日期輸入鏈接到 R 腳本中?

function(input, output) {
  # You can access the value of the widget with input$date, e.g.
  output$value <- renderPrint({ input$date })
}

這是一個最小的工作示例:

library(shiny)

ui <- fluidPage(
    dateRangeInput("date","Date:"),
    textOutput("value")
)

server <- function(input, output) {
    output$value <- renderPrint({ 
        x <- input$date
        # script using x goes here
        paste("choice:",x[1],"to",x[2]) # example output
        })
}
 
shinyApp(ui = ui, server = server)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM