create a numeric input. Display what's entered, multiplied by 2.
Drop files here
or click to upload
library(shiny)
ui <- fluidPage(
# Create numeric input
numericInput("number", "Enter a number:", value = 0),
# Display the result
h4("Result:"),
textOutput("result")
)
server <- function(input, output) {
output$result <- renderText({
# Multiply input by 2
input$number * 2
})
}
shinyApp(ui = ui, server = server)
Hi! I can help you with any questions about Shiny and R. What would you like to know?