首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

#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秒将生成一个不同的正常样本。... 展开详请
领券