output $ loc2 <- renderInfoBox ({: объект 'output' не найден - PullRequest
0 голосов
/ 08 января 2019

Я хочу сделать инфобокс в блестящем приложении. Я получаю сообщение об ошибке "output $ loc2 <- renderInfoBox ({: объект 'output' not found" </strong> в следующем коде:

library(shiny)
library(shinydashboard)
library(dplyr)
ui <- shinyUI(fluidPage(
  mainPanel(width = "1260px", 
        tabsetPanel(type = "tab",
                    tabPanel(h5("Labtest"), 
                             fluidRow(
                               radioButtons("Ben2", "Details:", 
c("Hypertension", "RBS", "HB", "Malaria"), inline = T),
                               infoBoxOutput("loc2", width = 960)))))))
server <- shinyServer(
output$loc2 <- renderInfoBox({
if(input$Ben2 == "Hypertension") {
box(width='100%', h3("Hypertension"),
infoBox(100, "Total", icon = icon('heartbeat'), width = 3, color = 
"orange", fill = T))          
} else{if(input$Ben2 == "RBS"){
infoBox(30, "Normal",  "Cummulative", icon = icon('heartbeat'), 
width = 3, color = "green", fill = T)
}
else {if(input$Ben2 == "HB"){
infoBox(30, "Pre-Hypertension", "Cummulative", icon = icon('heartbeat'), 
width = 3, color = "yellow", fill = T)
} else{
infoBox(40, "Hypertension", "Cummulative", icon = icon('heartbeat'), width = 
3, color = "red", fill = T)
}}
}}    
))

shinyApp(ui, server)

Может кто-нибудь помочь мне с этой ошибкой?

Спасибо.

Ответы [ 2 ]

0 голосов
/ 10 января 2019

Теперь логика работает правильно после закрытия и перезапускает ее.

0 голосов
/ 08 января 2019

сервер <- функция (вход, выход, сессия) {вместо блестящего сервера (</p>

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