首页
学习
活动
专区
圈层
工具
发布

#shiny

如何以固定的时间间隔更新图?

例如,你可以在本地运行以下代码: library(shiny) runApp(list( ui = pageWithSidebar( headerPanel("Hello Shiny!"), sidebarPanel( sliderInput("obs", "Number of observations:", min = 1, max = 1000, value = 500) ), mainPanel( plotOutput("distPlot") ) ), server =function(input, output, session) { autoInvalidate <- reactiveTimer(5000, session) output$distPlot <- renderPlot({ autoInvalidate() # generate an rnorm distribution and plot it dist <- rnorm(input$obs) hist(dist) }) } )) 每5秒将生成一个不同的正常样本。... 展开详请
领券