0
ui <- fluidPage(
sliderInput("obs", "Number of observations:",
min = 0, max = 1000, value = 500
),
plotOutput("distPlot")
)
# Server logic
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
# Complete app with UI and server components
shinyApp(ui, server)
我有一個簡單的應用程序與sliderInput
用戶可以切換和選擇觀察的數量。有沒有辦法對此進行修改,以便在此滑塊功能之上,用戶可以將他/她所需數量的觀察值輸入到一個框中,並且該輸入將反映在生成的直方圖中?我希望用戶能夠靈活地擁有滑塊,並且能夠快速輸入精確值,而無需一直依賴滑塊。如何修改shiny中的sliderInput以便用戶可以直接輸入值?