Ошибка: невозможно привести тип 'замыкание' к вектору типа 'любой' - PullRequest
0 голосов
/ 08 декабря 2018

Кто-нибудь может помочь, почему я получаю эту ошибку?пытается запустить в блестящем код приложения ниже

`

SERVER

server <- function(input, output)
{# Regression output b1 <- reactive({(sum((input$outcome - 
mean(input$outcome)) * (input$indepvar - 
mean(input$indepvar))))/sum((input$outcome - mean(input$outcome)) ^ 2)})b0 <- reactive({mean(input$indepvar) - b1 * mean(input$outcome)})

obj <- reactive({function (r) 
{fn <- function (b0, b1) 
{return (sum(input$indepvar - (b0 + b1 * input$outcome)) ^ 2)}
return (fn(r[1], r[2]))}})

ubound <- reactive({c(2, 1)})
lbound <- reactive({c(0, 0)})

output$summary <- renderPrint({ga_search <- ga(type = "real-valued",fitness = function (x) -obj(x),lower = lbound,upper = ubound,popSize = 50)

summary(ga_search) `

Любая помощь приветствуется

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...