mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-29 03:00:45 -04:00
* chore: restyle examples-shiny * chore: restore select newlines * More consistent approach to whitespace --------- Co-authored-by: Carson <cpsievert1@gmail.com>
19 lines
413 B
R
19 lines
413 B
R
library(shiny)
|
|
library(bslib)
|
|
|
|
# Define UI for displaying current time ----
|
|
ui <- page_fluid(
|
|
h2(textOutput("currentTime"))
|
|
)
|
|
|
|
# Define server logic to show current time, update every second ----
|
|
server <- function(input, output, session) {
|
|
output$currentTime <- renderText({
|
|
invalidateLater(1000, session)
|
|
paste("The current time is", Sys.time())
|
|
})
|
|
}
|
|
|
|
# Create Shiny app ----
|
|
shinyApp(ui, server)
|