0
我想在Shiny R中写一个简单的应用程序。 我想要两个输入(x和y)并绘制相对散点图。代码如下闪亮的R,Plot,ShinyApp
library(shiny)
ui<-fluidPage(
headerPanel('Plot'),
sidebarPanel(
sliderInput(inputId = 'x',label='X', value = 1,min=1,max=3),
sliderInput(inputId = 'y',label='Y', value = 1,min=1,max=3)
),
mainPanel(
plotOutput('plot')
)
)
server<-function(input,output) {
x <- reactive({input$x})
y <- reactive({input$y})
output$plot <- renderPlot({plot(x,y)})
}
shinyApp(ui=ui, server=server)
的代码产生一个错误,
cannot coerce type 'closure' to vector of type 'double'
我如何纠正呢?
非常感谢您