library(shiny)
data(mtcars) model <- lm(mpg ~ hp + am, data = mtcars)
shinyServer(function(input, output) { output\(prediction <- renderText({ # Подготовка данных из ввода df <- data.frame(hp = input\)hp, am = as.numeric(input$am)) res <- predict(model, newdata = df) paste(round(res, 2), “миль на галлон (MPG)”) }) })