2024-12-16
Shiny is an R package for building interactive web applications.
Combines the computational power of R with the interactivity of modern web technologies.
No web development experience required!
Create interactive dashboards for data visualization.
Share R analyses with non-programmers.
Integrate real-time data updates in your workflows.
library(shiny)
# Define UI
ui <- fluidPage(
titlePanel("Hello, Shiny!"),
sidebarLayout(
sidebarPanel(
sliderInput("num", "Choose a number:", 1, 100, 50)
),
mainPanel(
textOutput("result")
)
)
)
# Define Server
server <- function(input, output) {
output$result <- renderText({
paste("You selected:", input$num)
})
}
# Run the app
shinyApp(ui = ui, server = server)
server <- function(input, output) {
output$scatterPlot <- renderPlot({
plot(
x = rnorm(input$points),
y = rnorm(input$points),
col = input$color,
pch = 19
)
})
}
shinyApp(ui, server)
.