library(shiny)
library(shinydashboard)
library(shinythemes)
ui <- dashboardPage(
dashboardHeader(title = "LAP"),
dashboardSidebar(
sidebarMenu(
#menuItem("Introduction", tabName = "intro", icon = icon("info-circle")),
menuItem("test", tabName = "FD", icon = icon("info-circle"))
)),
dashboardBody(
tabItems(
tabItem(tabName = "FD",
fluidRow(
box(verbatimTextOutput("loc") )))
)
)
)
server =shinyServer(function(input, output){
mydata<- reactive({
for(i in 1:100){
print("For Demo Purpose")
}
})
output$loc<- renderPrint({
mydata()
})
})
shinyApp(ui= ui, server = server)library(shiny)
ui <- fluidPage( verbatimTextOutput("loc"))
server <- function(input, output, session) { rv <- reactiveValues(lines = character(0), n = 0) observe({ # Re-execute this reactive expression immediately after # it finishes (though you can also specify a longer time: # e.g. 1000 means re-execute after 1000 milliseconds have # passed since it was last executed) invalidateLater(0, session) isolate({ if (rv$n >= 100) { return() } else { rv$n <- rv$n + 1 rv$lines <- c(rv$lines, paste("Loop var =", rv$n)) } }) }) output$loc <- renderPrint({ rv$lines }) }
shinyApp(ui, server)library(shiny)
ui <- fluidPage( div(id = "placeholder"))
server <- function(input, output, session) { rv <- reactiveValues(n = 0) observe({ invalidateLater(0, session) isolate({ if (rv$n >= 100) { return() } else { rv$n <- rv$n + 1 insertUI("#placeholder", ui = p("Loop var = ", rv$n)) } }) })}
shinyApp(ui, server)