我正在尝试进行滑块输入并创建散点图,其点数与滑块输入相同。
我用R Script编写了这段代码。
library(shiny)
ui= basicPage(
sliderInput('n', 'Number of points:',
min=10, max=500, value=100),
plotOutput('distPlot')
)
server= function(input,output) {
output$distPlot = renderPlot ({
plot(rnorm(input$n) , rnorm(input$n))
})
}
shinyApp(ui,server)
简单的代码。但是我运行该应用程序,没有出现滑块。
唯一出现的是
“点数:”和一个矩形。
即使我在矩形中输入数字并按Enter键,也不会发生任何事情。
代码没有问题,但也许我用错误的方式处理了闪亮的应用程序。
Rstudio和Shiny都是最新的版本。