使用闪亮构建一个小应用程序,在我编写一个循环后,它一直给我错误

时间:2016-11-28 12:19:51

标签: loops shiny

使用闪亮构建一个小应用程序,在我编写循环后,它一直给我错误

为什么我收到此错误“评估嵌套太深:无限递归/选项(表达式=)?”

library(shiny)
ui<-fluidPage(
  numericInput(inputId = "S0",label = "price at time 0",value = 20),
  numericInput(inputId = "k",label = "exercise price",value = 20),
  numericInput(inputId = "N",label = "steps",value = 50),
  numericInput(inputId = "r",label = "riskfree rate",value = 0.03),
  numericInput(inputId = "t",label = "time to exercise data",value = 1),
   plotOutput(outputId = "v")
)

server<-function(input,output)
{

  ve<-reactive({vector(mode="numeric",length=input$N+1)})
  ve<-reactive({rep(input$N,9)})


  for(i in 1:10)   
  {
    ve<-reactive({c(ve(),i)})
  }

 output$v<-renderPlot({plot(ve())})

}


shinyApp(ui=ui,server=server)

for()句子似乎有问题

0 个答案:

没有答案